For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 2

Getting NAK posting via TSA using websocket api "UpdateMsg has no RSSL_UPMF_HAS_MSG_KEY flag"

Hi

I'm trying to use the Websocket API to make an off-stream post using a TREP service configured for TSA to TRCC. Currently I receive the following error

"NakCode":"DeniedBySrc", "Text":"UpdateMsg has no RSSL_UPMF_HAS_MSG_KEY flag",

Below is an extract of the message structure which is based on the code provided in the posting example for the Websocket API:

mp_post_json = {
  
'ID': 1,
'Type':'Post',
'Domain':'MarketPrice',
'Key': {
'Name': 'EAASTEST01',
'Service':'TSA_SERVICE'},
'Ack':True,
'PostID': post_id,
'PostUserInfo': {
'Address':position, # Use IP address as the Post User Address. 'UserID':os.getpid() # Use process ID as the Post User Id.},
'Message': {
'ID': 0,
'Type':'Update',
'Solicited': True,
'Fields':{'BID':45.55,
'BIDSIZE':18,
'ASK':45.57,
'ASKSIZE':19}
}
}

Thanks,

Bill

treprdp-apiwebsocketsrrtoposting
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.

Upvotes
Accepted
15.2k 41 12 19

Hi @billr, Sorry for the delay, the key has to be included in the encoded update message. This update message works for me for contributing to TSA:

var msg = {
                
"ID": 1,
"Type": "Post",
"Domain": "MarketPrice",
"Ack": true,
"PostID": postId,
"PostUserInfo": {
"Address": "127.0.0.1",
"UserID": 5324
},
"Key": {
"Name": "*****",
"Service": "****"
},
"Message": {
"Domain": "MarketPrice",
"ID": 0,
"Type": "Update",
"Fields": {
"BID": 45.55
},
"Key": {
"Name": "****",
"Service": "****"
}
}
};

Let me know if it doesn't work for you. Thanks.

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.

Upvotes
15.2k 41 12 19

Hi @billr Can you confirm that your user ID is allowed to post to TRCC service to these fields, and that off-stream posting is correctly configured in ADS (no errors in ADS log).

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.

Upvotes
1 0 0 2

Hi @Gurpreet. Yes I should be able to contribute to these FIDs, but to simplify things a little I have cut the FID list to just BID(22). Also I'm not sure what I see seems to reflect an issue with entitlement, but I'm new to TSA/TRCC so not 100%.

No errors in the ADS or ADH logs, but if I set trace for the source session on the ADH(session rsslReactor.1) the message reflects what I see at the client. Looking at what I sent 'updateType="0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)"' seems to be relevant. Looks like I'm just missing a key or have misconstructed the post message.

Sent:

[Wed Apr 17 10:07:31.416634 2019] RSSL Message Of Length 75 Sent on Socket 26 <!-- rwfMajorVer="14" rwfMinorVer="1" --> <genericMsg domainType="RSSL_DMT_SYSTEM" streamId="3" containerType="RSSL_DT_MSG" flags="0x19 (RSSL_GNMF_HAS_EXTENDED_HEADER|RSSL_GNMF_HAS_SEQ_NUM|RSSL_GNMF_MESSAGE_COMPLETE)" seqNum="5" dataSize="58"> <extendedHeader data="0100"/> <dataBody> <!-- rwfMajorVer="14" rwfMinorVer="1" --> <postMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="1" containerType="RSSL_DT_MSG" flags="0x66 (RSSL_PSMF_HAS_POST_ID|RSSL_PSMF_HAS_MSG_KEY|RSSL_PSMF_POST_COMPLETE|RSSL_PSMF_ACK)" postId="5057" postUserId="18040" postUserAddr="10.0.75.1" dataSize="20"> <key flags="0x7 (RSSL_MKF_HAS_SERVICE_ID|RSSL_MKF_HAS_NAME|RSSL_MKF_HAS_NAME_TYPE)" serviceId="10" name="EAASTEST01" nameType="1"/> <dataBody> <!-- rwfMajorVer="14" rwfMinorVer="1" --> <updateMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="0" containerType="RSSL_DT_FIELD_LIST" flags="0x0" updateType="0 (RDM_UPD_EVENT_TYPE_UNSPECIFIED)" dataSize="9"> <dataBody> <fieldList flags="0x8 (RSSL_FLF_HAS_STANDARD_DATA)"> <fieldEntry fieldId="22" data="0C11 CB"/> </fieldList> </dataBody> </updateMsg> </dataBody> </postMsg> </dataBody> </genericMsg>

Received:

[Wed Apr 17 10:52:51.884601 2019] RSSL Message Of Length 76 Received on Socket 26 <!-- rwfMajorVer="14" rwfMinorVer="1" --> <genericMsg domainType="RSSL_DMT_SYSTEM" streamId="3" containerType="RSSL_DT_MSG" flags="0x19 (RSSL_GNMF_HAS_EXTENDED_HEADER|RSSL_GNMF_HAS_SEQ_NUM|RSSL_GNMF_MESSAGE_COMPLETE)" seqNum="549" dataSize="59"> <extendedHeader data="0100"/> <dataBody> <!-- rwfMajorVer="14" rwfMinorVer="1" --> <ackMsg domainType="RSSL_DMT_MARKET_PRICE" streamId="1" containerType="RSSL_DT_NO_DATA" flags="0x22 (RSSL_AKMF_HAS_TEXT|RSSL_AKMF_HAS_NAK_CODE)" ackId="7233" nakCode="RSSL_NAKC_DENIED_BY_SRC" text="UpdateMsg has no RSSL_UPMF_HAS_MSG_KEY flag" dataSize="0"> <dataBody> </dataBody> </ackMsg> </dataBody> </genericMsg>

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.

Upvotes
15.2k 41 12 19

Hi @billr I am looking into it and will post my findings here.

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.

Upvotes
1 0 0 2

Hi @Gurpreet, That worked!!! thanks very much for your help. Much appreciated!!

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.