New subcription for same symbol

Hi team,


I had a question about 2 subscriptions for a same symbol like VOD.L with ID: 2 and ID:3. I get quote updates regularly for my ID:2. But my ID:3 request throws -

[{
  "Type": "Status",
  "State": {
    "Stream": "Closed",
    "Data": "Suspect",
    "Text": "Request Rejected: Cannot reopen item with different stream.",
    "Code": "AlreadyOpen"
  },
  "ID": 3,
  "Key": {
    "Service": "ELEKTRON_DD",
    "Name": "VOD.L"
  }
}]

For our product we have a scenario where we need two different workflows doing a subscription for VOD.L. Is it possible to do such requests at all? Or we would always get this above error?

Please let me know if you need anything else.


Thank you,

Bansal

Best Answer

  • Hi @bansalshah,

    To work around this scenario, you can try to provide different views (fields) when you make the request for each one. Alternatively, you can form a different WebSocket connection into the server.

Answers

  • So even if the symbol subscribed is made with two different set of views, it would be fine? And websocket would not complain?

    Because of the limit of 5 Websocket connections we do not want to create new connections on every new subscription.


    Thank you

  • Hi @bansalshah,

    Yes, the server will not complain and you should see updates for both.

  • Hi @bansalshah

    Just to be clear - you should not be creating 'new connections' for every new subscription. Generally speaking, the application should only need to create one websocket connection, one login and then open multiple streams - one for each subscription - as and when required.