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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
18 2 1 3

No Response for Multiple RIC streams

I viewed this question about stream id per ric vs batches to get an idea of how to approach this. I'm running into issues when I send multiple requests for stream (as opposed to Non-Streaming) data. When I send 4 separate requests to receive streaming data for some RICS. I only get streams for 2. I don't receive any responses (Status, Update, Refresh) for the other requests

Here's a (simplified) version of what my code looks like:

const rics = ['AAPL.OQ', 'IBM.N', 'DIS.N', 'TSLA.OQ']


for (const ric of rics) {
   //The request is made with ids: AAPL=>2, IBN=>3, DIS=>4, TSLA=>5
   //Helper method creates the message, and sends the message from the websocket
   sendStreamRequest(ric);
}

Example of what a message looks like:

{
  ID: 2,
  Key: {
    Name: 'AAPL.OQ'
  },
  Streaming: true,
  Type: 'Request'
}


My method to use an id for a stream (right now) is really simple. I start with id=2, and increment the id by 1 for each different RIC.

With the current code I have, I'll receive a response for the first 2 APPL, IBM, but no other responses for the other 2 messages I sent - not a Status, Refresh, or Update message.

Any ideas why this may be happening?

treprdp-apiwebsocketsrrtostream-id
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
17.8k 82 39 63

Hi @jonathan.powell,

The basic code you provided looks ok. Based on what you are seeing, I can only assume there may be some issues within the callbacks and how you are handling the messages. There are a few things you can try.

  1. Make sure you can retrieve all the data as expected. That is, change the size of your rics array to only contain 1 RIC per execution. Execute the app 4 times changing the ric each time.
  2. Try sending the rics as a batch. For example, simply pass in the rics array into the 'Name' parameter and observe the behavior. The 'Name' property can accept either a string or array of strings.
  3. Simplify your code to eliminate any post-processing except to print out the native JSON message received.

When I ran a simple example, this is what I submitted:

{
   "Key": {
      "Name": "IBM.N"
   },
   "Domain": "MarketPrice",
   "View": [
      "BID",
      "ASK",
      "DSPLY_NAME"
   ],
   "ID": 2
}

{
   "Key": {
      "Name": "DIS.N"
   },
   "Domain": "MarketPrice",
   "View": [
      "BID",
      "ASK",
      "DSPLY_NAME"
   ],
   "ID": 3
}

etc.


And the responses look like this:

{
   "ID": 2,
   "Type": "Refresh",
   "Key": {
      "Service": "ELEKTRON_DD",
      "Name": "IBM.N"
   },
   "Qos": {
      "Timeliness": "Realtime",
      "Rate": "JutConflated"
   },
   "PermData": "AwEBYsA=",
   "SeqNumber": 6096,
   "Fields": {
      "DSPLY_NAME": "INTL BUS MACHINE",
      "BID": 0.0,
      "ASK": 0.0,
   }
}

etc...


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.

Upvote
25.1k 57 17 14

Hello @jonathan.powell

Are you connecting to your local TREP or ERT in Cloud? Could you please share a full JSON messages log when the problem occurs?

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.