question

Upvotes
Accepted
3 2 4 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-sdkrrtema-apielektron-message-apilogging
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
@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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea