question

Upvotes
Accepted
3 5 6 10

Logging ReqMsg using EMA API

I have the following code to log the ReqMsg to stdout but application will get crash with segmentation fault in the cout line.

Can't we use ReqMsg like this. If not what is the way to log the ReqMsg.

try { 
AppClient client;
OmmConsumer consumer( OmmConsumerConfig().host( "localhost:14002" ).username( "user" ) );
ReqMsg reqMsg;
reqMsg.serviceName("DIRECT_FEED").name("IBM.N");
cout << reqMsg << endl;
consumer.registerClient( reqMsg, client );
sleep( 60000 );// API calls onRefreshMsg(), onUpdateMsg(), or onStatusMsg()
} catch ( const OmmException& excp ) {
cout << excp << endl;
}
elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apilogging
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.

@thimalk

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
@thimalk

EMA C++ does not allow the decoding of partially encoded messages.

If you are trying to debug your app, then you can enable low level tracing as follows:

In your EmaConfig.xml you can add the XmlTraceToFile parameter for the Channel that you wish to enable Xml Trace for.

e.g.

<Channel>
<Name value="Channel_1"/>
<ChannelType value="ChannelType::RSSL_SOCKET"/>
<CompressionType value="CompressionType::None"/>
<GuaranteedOutputBuffers value="5000"/>
<Host value="10.13.225.38"/>
<Port value="14002"/> 
<XmlTraceToFile value="1"/> 
</Channel>

The above should enable trace of request and response messages - default filename is 'EmaTrace'.
Please refer to section 3.2.2 of the EmaCPP_ConfigGuide.pdf for details on this and other XmlTrace related parameters.

Section 4.4.3 also illustrates an example that sets this value using Programmatic config (rather than EmaConfig.xml).

Regards,

Umer

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.