Sometimes No response from webhook[on_message() is stopped] with V3 api, I see this twice/thrice in a week, its is random

I mean, on_message() is stopped.

Below is the code snippet.

configuration = upstox_client.Configuration()
configuration.access_token = access_token
streamer = upstox_client.MarketDataStreamerV3(upstox_client.ApiClient(configuration), instrument_keys, “full”)

def on_message(message):
print(“on_message:”, message)
def on_reconnection_halt(message):
print(“on_reconnection_halt:”, message)
def on_error(message):
print(“on_error:”, message)

streamer.auto_reconnect(True)
streamer.on(“message”, on_message)
streamer.on(“autoReconnectStopped”, on_reconnection_halt)
streamer.on(“error”, on_error)
streamer.connect()

In V2 api along with protobuff there was exception incase of any failure which helped to handle the error case. any pointers on this?

@ayappan_chellappan

Do you notice this behavior occurring within a specific timeframe, like every morning between 9–11, or for specific instrument key? Something along those lines.

Thanks!

today it happened @11:37 AM. I think earlier it was10:00 to 11:00 AM approx.

@ayappan_chellappan

A few more questions:

  • Does this apply to all instrument keys or only specific ones?
  • Does it resume immediately after reconnecting?
  • Have you exceeded the limits mentioned here?

Hi Shanmu,

  1. I register multiple instrument keys(around 50 plus)… when the problem occurs there will be no data for all instrument keys, on_message() is stopped.
  2. It works after restart the code.
  3. No other api’s used except Webhook. In V3 api upto 2000 instrument keys can be registered, I registered less than 100 instrument keys,

May I know how user is notified in case of internet connectivity issues or any other internal issues?

@ayappan_chellappan, error listeners currently only receive events for server-side issues, not client-side. However, that’s a valid point for the feeder, and we’ll include it in a future SDK update.

Regarding the issue you mentioned, we’ll investigate to see if there are any general disconnects and try reproducing it on our end.

Let’s wait and see how it goes.

Thanks!

@shanmu, Thank you. In the event of a hang or failure, please provide the necessary callbacks, messages, or events that would allow the user to reset the system. When can we expect the fix to be implemented?

FYI, In the event of network issue or failure, V2 protobuf model raise exception which allowed to reset the system.