how can I change from streaming to snapshot on RTO

MoisesGomez27
edited March 26 in WebSocket API

can anyone provide me with a guide on how to change from Streaming to Snapshot for a RTO connection, API using is not clear might be websocket, so if there is a list of resources for different APIs will be great.

Best Answers

  • Gurpreet
    Gurpreet admin
    Answer ✓

    Hello @MoisesGomez27

    If your current websockets code is sends the streaming data request, then to change the code to send a snapshot request, set the streaming flag to false as shown below:

    {
      "ID": 2,
      "Key": {
        "Name": ["IBM.N", "GE.N", "TD.TO", "RY.TO"],
        "Service": "ELEKTRON_DD"
      },
      "View": ["BID", "ASK", "BIDSIZE"],
      "Streaming": false
    }
    
    
  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @MoisesGomez27

    If you are using the EMA API, you can use the reqMsg.interestAfterRefresh(false) method to change from streaming request to snapshot request.

    consumer.registerClient(
    reqMsg.serviceName("DIRECT_FEED").name("IBM.N").interestAfterRefresh(false), appClient
    );