Skip to content
CCPEDIAby Unity Nodes
App Development

Streaming API websocket stops sending messages

3 posts302 views6 likesLast activity Oct 2021

  1. rui.genesisOP 1

    Hi comunity,

    I’m using Daml SDK 1.16.0 with a Sandbox ledger and JSON API. I’ve used the Websocket, provided by /v1/stream/query API to listen a Contract’s events. After 2h it stops sending messages, but the connection seems to be open, at least I can send ping frames. Do I have to setup any additional configs to have longer connections ? Or is it some limitation from JSON API ?

  2. cocreature 4

    Hi @rui.genesis, take a look at the corresponding Github issue. Right now this is expected behavior to avoid resource leakage.

    The JSON API allows you to reconnect and continue streaming at a given offset once your connection gets lost.

    Depending on your network setup your connections might also be much shorter. IIRC the google load balancer kills connections after 2 minutes rather than 2 hours.

  3. rui.genesis 1

    Hi,
    Thank you for your answer. I will use your suggestion, using a strategy to renew connections.