question

Upvotes
Accepted
17 2 4 2

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-sdkrrtema-apielektron-message-apic++OMMunregister
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
20.3k 73 10 20

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea