question

Upvotes
Accepted
34 6 12 17

stream id after registerClient call

How do I get streamId after calling registerClient.

consumer.registerClient( ReqMsg().domainType( domain ).serviceName( subService ).name( subSymbol ), client );



I want to get the stream Id for the subSymbol. How do I get that?

trepema-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
32.2k 40 11 20

Hello @vishal.anand ,

I suspect that you may be looking for a handle that is returned by registerConsumer call, that can be used to unregister the item, for example:

long handle = consumer.registerClient(reqMsg.serviceName("ELEKTRON_DD").name("IBM.N"), appClient);

Thread.sleep(5000);

consumer.unregister(handle);

If you are looking for the streamId it can be found in the received messages, in the attributes, for example:

UpdateMsg
    streamId="5"
    domain="MarketPrice Domain"
    updateTypeNum="1"
    name="IBM.N"
    serviceId="356"
    serviceName="ELEKTRON_DD"
    Payload dataType="FieldList"
        FieldList
            FieldEntry fid="22" name="BID" dataType="Real" value="130.510000"
            FieldEntry fid="25" name="ASK" dataType="Real" value="130.540000"


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @zoya faberov Is there any way I can relate the log handle returned by registerClient call to that of streamId? How would i know the log handle returned and the streamId are for the same request? Do we expect both to be the same?

Hello @vishal.anand ,

You can:

From a refresh or an update, we can obtain both handle and streamID.

To obtain handle:

event.handle();

To obtain streamId we parse Attrib part of the message, see example 290 Custom_Decode for the code.

From that point on, you can create a map and store the relationship, and always map the handle and the streamId.

I am curious, what is your use case, why is it helpful to relate the two?

Thanks @zoya faberov . That works and actually I used event.getHandle().


The use case is that we are writing a client to Feed Handler that will send request and check how many were received back and how many had errors. Basically some kind of monitoring app so the app needs to know specifically which requests were solicited.

Show more comments
Upvotes
34 6 12 17

Yes my bad, I am using EMA Real-Time-SDK-2.0.6.L1.linux

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.