Hi,
I am trying to contribute to a RIC that has the PERM_CODE FID. I am creating a Post message with 2 Fields encoded, 1 fr the permission FID with the code and 2nd for the price FID i want to update. However I keep getting this error
Message ID 4.0 received NACK : A29: Post message did not contain permission data.
I am sure my postMsg with multiple FID update works because I tried it on another RIC which does not require the permission code.
Any pointers here will be very helpful!
Thanks.
OMMEncoder encoder = publisherPool.acquireEncoder();
OMMMsg ricPubMsg = publisherPool.acquireMsg();
ricPubMsg.setMsgType(OMMMsg.MsgType.POST);
ricPubMsg.setId(id);
ricPubMsg.setMsgModelType(RDMMsgTypes.MARKET_PRICE);
ricPubMsg.setPriority((byte) 1, 1);
// A single-part post message that needs init, complete and ack indications.
int indicationFlags = OMMMsg.Indication.POST_COMPLETE | OMMMsg.Indication.POST_INIT | OMMMsg.Indication.NEED_ACK;
ricPubMsg.setIndicationFlags(indicationFlags);
ricPubMsg.setAttribInfo(key.serviceName, key.ric, RDMInstrument.NameType.RIC);
encoder.initialize(OMMTypes.MSG, 1000);
encoder.encodeMsgInit(ricPubMsg, OMMTypes.NO_DATA, OMMTypes.FIELD_LIST);
encoder.encodeFieldListInit(OMMFieldList.HAS_STANDARD_DATA | OMMFieldList.HAS_INFO, (short) 1, (short) 0, (short) 2);
int count = 0;
for(RField fid : key.fids) {
FidDef fidDef = dictionary.getFidDef(fid.id);
short fidType = fidDef.getOMMType();
encoder.encodeFieldEntryInit(fidDef.getFieldId(), fidType);
String rep;
Object value = values.get(count);
if(value == null){
rep = "";
}else{
Class<?> valueClass = value.getClass();
if (fidType == OMMTypes.UINT) {
encoder.encodeUInt(Long.parseLong(value.toString()));
} else {
if(Float.class.equals(valueClass) || Double.class.equals(valueClass)){
rep = DECIMAL_FORMAT.format(value);
}else{
rep = value.toString();
}
encoder.encodeString(rep, fidType);
}
}
count++;
}
encoder.encodeAggregateComplete();
OMMMsg pubMsg = (OMMMsg) encoder.getEncodedObject();