Websockets posting results in error "F5: Source application did not respond. Insert request timeout.

Post message using websockets with local TREP is well formed (identical to examples), but I instead of Ack I get an error "F5: Source application did not respond. Insert request timeout. Please retry." I'm able to retrieve the record from the service (DTS), but posting fails. What could be the reason?

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @pj.chan

    Like @Gurpreet. suggestion, you JSON OMM Post message does not include the ID attribute to identify whether the post is On-Stream or Off-Stream post. You can see an example of Posting in market_price_posting.py file (any example with name *Post* based on your prefer complier).

    The Off-Steam Post means you send the post message in the Login stream. You need to set the post message's ID to be the same as your login message and set the Post item name and service name.

    Example:

    Login:

    {
    'ID': 1,
    'Domain': 'Login',
    'Key': {
    'Name': 'user',
    'Elements': {
    'ApplicationId': '112',
    'Position': '127.0.0.1/net'
    }
    }
    }

    Post message:

    {
    'ID': 1,
    'Type':'Post',
    'Domain':'MarketPrice',
    'Ack':True,
    'PostID':1,
    'PostUserInfo': {
    'Address': '172.20.110.92'
    'UserID':14736
    },
    'Key':{
    'Name':'POST.DATA',
    'Service': 'POST_SERVICE'
    },
    'Message': {
    'ID': 0,
    'Type':'Update',
    'Domain':'MarketPrice',
    'Fields':{'BID':45.55,'BIDSIZE':18,'ASK':45.57,'ASKSIZE':19}
    }
    }

    The On-Stream Post means you send the post message in data stream you have subscribed. You need to set the post message's ID to be the same as your item request message. The post item name and service will be same as item that you have subscribed.

    Example:

    Item request:

    {'ID': 3, 'Key': {'Name': 'POST.DATA', 'Service': 'POST_SERVICE'}}

    Post message:

    {
    'ID': 3,
    'Type':'Post',
    'Domain':'MarketPrice',
    'Ack':True,
    'PostID':1,
    'PostUserInfo': {
    'Address': '172.20.110.92'
    'UserID':14736
    },
    'Message': {
    'ID': 0,
    'Type':'Update',
    'Domain':'MarketPrice',
    'Fields':{'BID':45.55,'BIDSIZE':18,'ASK':45.57,'ASKSIZE':19}
    }
    }

Answers

  • Hello @pj.chan

    This message is generated from the TREP level. Could you please share your JSON Post message? Which type of Posting (On-Stream - via Item request stream id, Off-Stream - via Login stream id) that the application is using?

    You may find more detail regarding the OMM Posting with ATS via the following articles:

  • Wasin Waeosri, thanks for your response and useful links. The json for the post was pretty much identical to what I saw in examples provided:

    {"Domain":"MarketPrice","Ack":true,"PostID":1,"PostUserInfo":{"Address":"172.20.110.92","UserID":14736},"Message":{"ID":0,"Type":"Update","Domain":"MarketPrice","Fields":{"BID":10.0}},"Type":"Post","ID":2}

    I didn't see the StreamId in the samples. The value assigned to ID was the same ID send with the subscription request.

    I'll check those links you shared and see if that gives me better clues than the samples. Or grateful if you can provide other advice.

  • @pj.chan Is it an on or off stream posting. For on stream posting, you will need the stream ID as the ID for the post. For off stream posting you will need the item name and service in the Key object.

  • Gurpreet.Wasin Waeosri, if you see my (not very nicely formatted) JSON, the ID is the last element ("ID":2), and 2 was the ID of the request. My fields are not in the same order as yours, but I believe are all there. Below a slightly better formatted version

    {
    "Domain":"MarketPrice",
    "Ack":true,
    "PostID":1,
    "PostUserInfo":{
    "Address":"172.20.110.92",
    "UserID":14736
    },
    "Message":{
    "ID":0,
    "Type":"Update",
    "Domain":"MarketPrice",
    "Fields":{"BID":10.0}
    },
    "Type":"Post",
    "ID":2
    }

    I think the double quotes would be a result of my logging rather than the serialisation.

    Does it matter if the request was for snapshot or streaming? (it was streaming in our case).

    I didn't try posting in the login stream, but I will

  • The order of the fields isn't important in JSON. A few basic questions before we dig in:

    1. Are you allowed to post?

    2. What is your infrastructure setup (ADS, ?, ?)

    3. Is it setup for on stream or off stream posting?

  • Another app is publishing via RFA to the same record using the same user name, so I imagine we are allowed to post (unless authorisation to post is separate for each API).

    I'm not completely familiar with the infrastructure (it is a client site), but they must have ADS and DTS (we are posting to DTS). I wasn't aware that the platform needs to be setup specifically for on stream or off stream (if that's what you mean). I need to check what kind of posting is being done via RFA.

    We were trying (and failing) on stream posting, so I will try off stream and see if that works.

    Thanks!

  • Hello @pj.chan

    Question: Does it matter if the request was for snapshot or streaming? (it was streaming in our case).

    Answer: The item request before post request should be a streaming. The snapshot request will close it stream immediately, so you cannot use its stream to post data.

    Did you subscribe to the post item before you send the post message?

  • Wasin Waeosri

    Yes, I subscribed to the item before posting (with streaming). I haven't had a chance to test off stream posting, but I will do in the next couple of days.

    Regards

    Pedro

    ReRegards

  • Hello @pj.chan

    Do you have any updates? Can you Off-Stream post data?

  • Hi @Wasin Waeosri, yes, we were able to post off-stream, so I guess TREP was permissioned for that and not for on-stream? Apologies for not posting an update earlier.

  • Hello @pj.chan, glade to hear that. Does that TREP server is the same instance that accept your RFA on-stream post? Do your websocket and RFA applications send the post message to the same TREP at the same time?

  • @wasin.w @Gurpreet @pj.chan - I have encountered with the similar issue, updating to instrument is failing, - "Text":"F5: Source application did not respond. Insert request timeout. Please retry.",

    Here is the json code :-

    {

    "Ack":true,

    "Domain":"MarketPrice",

    "ID":1,

    "Key":{

    "Name":"MCQ.FUT.DERIVED.IFEU.DBI.F.2023.08.20230801.F.0",

    "Service":"DTS"

    },

    "Message":{

    "Domain":"MarketPrice",

    "Fields":{

    "TRDPRC_1":89.4542,

    "X_BU":"FUTURES"

    },

    "ID":0,

    "Type":"Update"

    },

    "PostID":2,

    "PostUserInfo":{

    "Address":"192.168.29.65",

    "UserID":16588

    },

    "Type":"Post"

    }



    Appreciate your advise.