question

Upvotes
Accepted
21 0 2 3

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 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
20.3k 73 10 20

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea