When we are trying to subscribe for instruments (EUR=TRB, EUR=, AUD=TRB, etc) the first RefreshMessage is fine, but next UpdateMessages always throw NullPointerException from toString() method or during payload parsing.
- How we can find out whats wrong
- Could you provide documentation, how to configure logging for error or warning messages from Reuters Ema API.
Example of the valid RefreshMsg from log file:
[2018-07-02 10:37:42.310] [INFO ] [hz.client_0.event-5] - r.s.f.r.i.DefaultReutersApiConnector.() - ***REUTERS. Subscription stream is opened for symbol AUD/USD and Reuters item AUD=TRB
[2018-07-02 10:37:42.348] [DEBUG] [pool-213-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Refresh msg: RefreshMsg
streamId="12"
domain="MarketPrice Domain"
solicited
RefreshComplete
state="Open / Ok / None / 'All is well'"
itemGroup="00 01"
permissionData="03 01 01 54 90 c0"
name="AUD=TRB"
nameType="1"
serviceId="257"
serviceName="IDN_SELECTFEED"
Payload dataType="FieldList"
FieldList FieldListNum="0" DictionaryId="1"
FieldEntry fid="22" name="BID" dataType="Real" value="0.73705"
FieldEntry fid="25" name="ASK" dataType="Real" value="0.73715"
FieldEntry fid="3386" name="QUOTE_DATE" dataType="Date" value="02 JUL 2018"
FieldEntry fid="3754" name="SCALING" dataType="Rmtes" value=" 1"
FieldEntry fid="3791" name="START_DT" dataType="Date" value="05 JUL 2018"
FieldEntry fid="3855" name="QUOTIM_MS" dataType="UInt" value="27461021"
FieldListEnd
PayloadEnd
RefreshMsgEnd
Example of the failed UpdateMsg from logs:
[2018-07-02 10:37:42.693] [DEBUG] [pool-213-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Update msg: [!!!com.thomsonreuters.ema.access.UpdateMsgImpl@46fc4f6f=>java.lang.NullPointerException:null!!!]
[2018-07-02 10:37:42.693] [WARN ] [pool-213-thread-1] - r.s.f.r.i.ReutersConsumerClient.() - Exception during UpdateMsg decoding
java.lang.NullPointerException: null
Xml and EmaFactory configurations:
this.view = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
array.add(EmaFactory.createOmmArrayEntry().intValue(BID_ID)); // 22
array.add(EmaFactory.createOmmArrayEntry().intValue(ASK_ID)); //25
array.add(EmaFactory.createOmmArrayEntry().intValue(QUOTE_DATE)); //3386
array.add(EmaFactory.createOmmArrayEntry().intValue(QUOTIM_MS)); //3855
array.add(EmaFactory.createOmmArrayEntry().intValue(SCALING)); //3754
array.add(EmaFactory.createOmmArrayEntry().intValue(START_DT)); //3791
this.view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
this.view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
<?xml version="1.0" encoding="UTF-8"?><EmaConfig>
<!-- ConsumerGroup provides set of detailed configurations to be used by named consumers -->
<!-- Application specifies which configuration to use by setting OmmConsumerConfig::consumerName() -->
<ConsumerGroup>
<ConsumerList>
<Consumer>
<!-- Name is mandatory --> <Name value="fxp_consumer"/>
<!-- Channel is optional: defaulted to "RSSL_SOCKET + localhost + 14002" --> <!-- Channel or ChannelSet may be specified -->
<Channel value="our_channel"/>
<XmlTraceToStdout value="0"/>
</Consumer> </ConsumerList>
</ConsumerGroup>
<ChannelGroup>
<ChannelList>
<Channel>
<Name value="our_channel"/>
<!-- ChannelType possible values are: -->
<!-- ChannelType::RSSL_SOCKET - TCP IP connection type -->
<!-- ::RSSL_HTTP - Http tunnel connection type -->
<!-- ChannelType::RSSL_ENCRYPTED - Https tunnel connection type -->
<ChannelType value="ChannelType::RSSL_SOCKET"/>
<Host value="{{ reuters_host }}"/>
<Port value="{{ reuters_port }}"/>
<GuaranteedOutputBuffers value="5000"/>
</Channel>
</ChannelList>
</ChannelGroup></EmaConfig>