Ticker disconnected and reconnected multiple times


  • Java :

    SmartStreamTicker is successfully connected in the morning with only 3 instruments being subscribed.

    Issue seen from "2024-12-03 08:46:12,060" to "2024-12-04 19:20:22,365" Until program was restarted manually.

    Line 10590: 2024-12-03 08:46:12,060 +0530 [AAAC118482_BotInvokerThread] INFO  (SmartStreamTicker.java:384) - connected to uri: wss://smartapisocket.angelone.in/smart-stream
    Line 18326: 2024-12-03 14:48:10,938 +0530 [Timer-0] INFO  (SmartStreamTicker.java:256) - reconnectAndResubscribe - started
    Line 18328: 2024-12-03 14:48:19,168 +0530 [Timer-0] INFO  (SmartStreamTicker.java:384) - connected to uri: wss://smartapisocket.angelone.in/smart-stream
    Line 18329: 2024-12-03 14:48:19,169 +0530 [Timer-0] INFO  (SmartStreamTicker.java:263) - reconnectAndResubscribe - done
    
    Line 34850: 2024-12-04 19:20:18,925 +0530 [Timer-49] INFO  (SmartStreamTicker.java:256) - reconnectAndResubscribe - started
    Line 34852: 2024-12-04 19:20:20,066 +0530 [Timer-49] INFO  (SmartStreamTicker.java:384) - connected to uri: wss://smartapisocket.angelone.in/smart-stream
    Line 34853: 2024-12-04 19:20:22,125 +0530 [Timer-51] INFO  (SmartStreamTicker.java:256) - reconnectAndResubscribe - started
    Line 34854: 2024-12-04 19:20:22,365 +0530 [Timer-49] INFO  (SmartStreamTicker.java:263) - reconnectAndResubscribe - done
    

    Suddenly, we see that the ticker gets disconnected and the library itself tries reconnection.
    This toggling happens on and on between connect and disconnect.

    Finally resulting in "Too Many Requests" error.

    2024-12-04 19:20:22,695 +0530 [Timer-51] ERROR (LogUtil.java:22) - AngelOne ticker Error for AAAC118482
    com.neovisionaries.ws.client.OpeningHandshakeException: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 429 Too Many Requests
    	at com.neovisionaries.ws.client.HandshakeReader.validateStatusLine(HandshakeReader.java:232)
    	at com.neovisionaries.ws.client.HandshakeReader.readHandshake(HandshakeReader.java:54)
    	at com.neovisionaries.ws.client.WebSocket.readHandshake(WebSocket.java:3244)
    	at com.neovisionaries.ws.client.WebSocket.shakeHands(WebSocket.java:3123)
    	at com.neovisionaries.ws.client.WebSocket.connect(WebSocket.java:2155)
    	at com.angelbroking.smartapi.smartstream.ticker.SmartStreamTicker.connect(SmartStreamTicker.java:383)
    	at com.angelbroking.smartapi.smartstream.ticker.SmartStreamTicker.reconnectAndResubscribe(SmartStreamTicker.java:258)
    	at com.angelbroking.smartapi.smartstream.ticker.SmartStreamTicker.access$400(SmartStreamTicker.java:29)
    	at com.angelbroking.smartapi.smartstream.ticker.SmartStreamTicker$2.run(SmartStreamTicker.java:239)
    	at java.base/java.util.TimerThread.mainLoop(Timer.java:566)
    

  • @Moderator_3

    User id : AAAC118482

    Please respond. We have only subscribed for 3 instruments only.
    NIFTY, BANKNFTY and NATGASMINI only were subscribed

    The java library code itself is reconnecting repeatedly.

    Kindly respond. Please!


  • Hi @futunc

    The total limit/quota of token subscriptions is 1000 per WebSocket session.

    Please refer WebSocket Streaming 2.0 documentation to get know limitations :
    https://smartapi.angelbroking.com/docs/WebSocket2

    Regards, SmartAPI Team