question

Upvotes
Accepted
19 4 5 4

Invalid attempt to close batch stream. Exception thrown in thomsonreuters::ema::access::OmmInvalidUsageExceptionImpl

Hi,

I have this issue with consumer.unregister() in EMA C++ SDK 1.4.0L1 as well in 1.5.0.L1.


The issue is that after I register a client (consumer is type OmmConsumer) using the batch mode, (thomsonreuters::ema::rdm::ENAME_BATCH_ITEM_LIST)

UInt64 handle = consumer.registerClient(...thomsonreuters::ema::rdm::ENAME_BATCH_ITEM_LIST...)

everything works OK except the unregister.

Calling consumer.unregister(handle); I get exception:

thomsonreuters::ema::access::OmmInvalidUsageExceptionImpl

and in EMA log file I do get:

Invalid attempt to close batch stream. Instance name='EmaConsumer_1'.


Unregister call (consumer.unregister(handle) ) works OK when I am NOT using BATCH mode.

This happens only for the BATCH mode consumer type.

Any ideas much appreciated.

Thank you,




elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apic++OMMunregister
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.

Hello @Ionut T,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
25.3k 87 12 25

Hi @Ionut T

The Batch handle is automatically closed by EMA once it makes the batch request - as each item has its own individual handle & stream established by the API - since each item is updated individually and therefore needs its own stream.

If you want to close the individual items you can extract the handle from the OmmConsumerEvent that you receive in your event handlers e.g.

void AppClient::onUpdateMsg( const UpdateMsg& updateMsg, const OmmConsumerEvent& ommEvent )
{
...
    _pOmmConsumer->unregister( ommEvent.getHandle() );
...
}

If you want to unregister all items you need to get hold of the Login handle as demonstrated in example 333__Login__Streaming__DomainRep

You can then unregister the Login handle - which will close all items and log you out from the server as well.



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.