The streamer auto connect does not work once the web socket connection breaks it does not recover

I have the following code where I also configure auto connect, but once the connection breaks like today morning itself, it does not recover

> streamer.on("message", on_message)
# Modify auto-reconnect parameters: enable it, set interval to 10 seconds, and retry count to 3
streamer.auto_reconnect(True, 20, 3)

streamer.connect()

process_thread2.start()
#process_thread3.start()
process_thread4.start() 
#process_thread6.start()

print("hello from main")

@Ketan @Pradeep_Jaiswar

anyone here to help?? I am facing this problem again today @Ketan @Pradeep_Jaiswar

Hi @sameer_siddiqui
The code indicates a reconnect attempt after 20 seconds. Could you please share the logs from these reconnect attempts?

I also suggest decreasing the reconnect interval after a disconnection.

Thanks!

@Ketan I have changed it to, streamer.auto_reconnect(True, 5, 3)

still facing this issue, right now, shortly after open, there is web-socket freeze, no prices are updating, how can I collect logs from the reconnect attempts? I am currently facing this issue, if you tell me how to, I can give logs also

Hi @sameer_siddiqui,

Are you currently using the V2 WebSocket? Please note that V2 WebSocket will soon be deprecated as per this announcement.

We recommend switching to the V3 streamer functions. You can refer to these example codes for guidance on using the V3 WebSocket and in V3 websocket you should not get this issue.

Thanks!

@Ketan what update is required for this? streamer = upstox_client.MarketDataStreamerV3(
AttributeError: module ā€˜upstox_client’ has no attribute ’MarketDataStreamerV3

@sameer_siddiqui you would need to update your python SDK, latest version is 2.16

1 Like