question

Upvote
Accepted
401 17 17 33

How to enable tracing incoming/outgoing messages EMA Java receives/sends

I would like to see messages that EMAJ sends and receives. How to enable tracing to see these?

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijava
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
23.6k 84 10 22

For xml tracing you need to use <XmlTraceToStdout value="1" /> in the EmaConfig.xml file under the Channel Config e.g.

		<Channel>
			<Name value="Channel_2"/>
			<ChannelType value="ChannelType::RSSL_SOCKET"/>
			<CompressionType value="CompressionType::None"/>
			<GuaranteedOutputBuffers value="5000"/>
			<Host value="122.1.1.100"/>
			<Port value="14002"/>
			<XmlTraceToStdout value="1" />
		</Channel>

You should then see the Incoming and Outgoing messages on the std out.

Obviously, you can redirect Std Out to a file using standard Java functionality e.g.

try { 
	System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("output.txt")))); 
} catch (FileNotFoundException e) 
{ 
	// TODO Auto-generated catch block e.printStackTrace(); 
}

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.

Upvotes
9.5k 10 5 7

Make sure that the application loads the configuration from EmaConfig.xml. For example:

consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().consumerName("Consumer_2"));

The snipped configuration xml:

<ConsumerList>

<Consumer>

<Name value="Consumer_2"/>

<Channel value="Channel_2"/>

<Dictionary value="Dictionary_2"/>

</Consumer>

</ConsumerList>

<ChannelList>

<Channel>

<Name value="Channel_2"/>

<XmlTraceToStdout value="1"/>

<ChannelType value="ChannelType::RSSL_SOCKET"/>

<CompressionType value="CompressionType::None"/>

<GuaranteedOutputBuffers value="5000"/>

<Host value="adsserver"/>

<Port value="14002"/>

</Channel>

</ChannelList>

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.