question

Upvotes
Accepted
21 0 2 4

Post Id must exist for multiple part post message

Hi Everyone,

I am getting this error when I post using an OMM Consumer:

Post Id must exist for multiple part post message

I am not sure I understand, I create the message like so:

private OMMMsg createMsg(final Map<String, String> data) {

    encoder.initialize(OMMTypes.MSG, 1000);
    encoder.encodeMsgInit(marketDataItemCont, OMMTypes.NO_DATA, OMMTypes.FIELD_LIST);
    encoder.encodeFieldListInit(OMMFieldList.HAS_STANDARD_DATA, (short) 0, (short) 1, (short) 0);

    for (Entry<String, String> d : data.entrySet()) {

      final Integer id = RfaUtils.getFieldId(d.getKey());
      final String value = d.getValue();
      encoder.encodeFieldEntryInit(id.shortValue(), OMMTypes.ASCII_STRING);
      encoder.encodeString(value, OMMTypes.ASCII_STRING);
    }

    encoder.encodeAggregateComplete();
    return (OMMMsg) encoder.getEncodedObject();
}

public int postMsg(final Map<String, String> data) {

      marketDataItem.clear();
      marketDataItem.setMsgModelType(RDMMsgTypes.MARKET_PRICE);
      marketDataItem.setMsgType(OMMMsg.MsgType.POST);
      marketDataItem.setAttribInfo(serviceName, itemName, RDMInstrument.NameType.RIC);
      marketDataItem.setIndicationFlags(OMMMsg.Indication.NEED_ACK);

      ommPostHandleItemCmd.setMsg(createMsg(data));
      ommPostHandleItemCmd.setHandle(contribHandle);
      return ommConsumer.submit(ommPostHandleItemCmd, contribHandle);
}

Does someone see something wrong?

Thanks,

Gabriel

treprfarfa-apiOMMcontributionspost
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.

1 Answer

· Write an Answer
Upvotes
Accepted
25.3k 89 12 25

Hi @glr

Are you setting a PostID for each post msg anywhere in your code e.g.

marketDataItem.setId(iPostId);

Assuming that marketDataItem is your OmmMsg.

Post ID is the unique identifier (that distinguishes different post messages). Each part in a multi-part post message must use the same postId value.
postId allows for values ranging from 0 to 4,294,967,295.

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.