Imported from previous forum
We just started running the CME’s java sample code - it worked correctly on all our test data, but when we hooked it up to the feed we found that the decoder occasionally throws. Evidently, the decoder is treating template ID’s as signed ints rather than unsigned ints. Has anyone else had this problem? If the fix is simple, a code snippet would be greatly appreciated.
I noticed the same thing. The latest java sample code on the site works correctly. However, if you would like to update your current code:
com.cme.fest.protocol.fast.FastTemplateIdDecoderStrategy.java: line 63 - change to decode a UInt32 and the templateID variable needs to be extracted using getUnsignedInteger()
I have not used the CME sample encoder, but I assume that there is a symmetric bug there also.
Franz
We just started running the CME’s java sample code - it worked correctly
on all our test data, but when we hooked it up to the feed we found that
the decoder occasionally throws. Evidently, the decoder is treating
template ID’s as signed ints rather than unsigned ints. Has anyone else
had this problem? If the fix is simple, a code snippet would be greatly
appreciated.
Thanks so much for the tip! Do you (or does anyone else) know of any other bugs in the CME sample code?
For the record, here is the code change I used to fix:
OLD:
DecodedValue result = decoder.decodeInt32(buffer, offset);
int templateId = result.getValue();
NEW:
DecodedValue result = decoder.decodeUInt32(buffer, offset);
int templateId = result.getValue().getUnsignedInteger();
I noticed the same thing. The latest java sample code on the site works
correctly. However, if you would like to update your current code:com.cme.fest.protocol.fast.FastTemplateIdDecoderStrategy.java: line 63 -
change to decode a UInt32 and the templateID variable needs to be
extracted using getUnsignedInteger()I have not used the CME sample encoder, but I assume that there is a
symmetric bug there also.Franz
We just started running the CME’s java sample code - it worked
correctly on all our test data, but when we hooked it up to the feed
we found that the decoder occasionally throws. Evidently, the decoder
is treating template ID’s as signed ints rather than unsigned ints.
Has anyone else had this problem? If the fix is simple, a code snippet
would be greatly appreciated.