Looks like the system is automatically changing to quote mode because I am connecting with full mode on daily basis. Is this a bug? I never change my mode. I observed this when I started getting runtime errors as I have fixed the fields that I need to receive and process. Also i am not making any 'quote' call anywhere as tickers are active below is my code.
def on_connect(ws, response): tickerlog.info("Successfully connected. Response: {} {}".format(response,len(instrument_tokens))) if len(instrument_tokens) > 0: ws.subscribe(instrument_tokens) ws.set_mode(ws.MODE_FULL, instrument_tokens) tickerlog.info("Subscribe to tokens in Full mode: {}".format(instrument_tokens))
Hi @sujith some more input. ws connection keeps on closing and reconnecting in two three minutes. hoping it is not connecting in quote mode by default as I am not using any custom reconnect.
While subscription of instrument token, default mode is set as Quote. You can check required assignment code here.
ws.set_mode(ws.MODE_FULL, instrument_tokens)
Then immediately, your requested mode is set. You can check the code here.
ws connection keeps on closing and reconnecting in two three minutes. hoping it is not connecting in quote mode by default as I am not using any custom reconnect.
And, while re-connection(after error), it by default resubscribes to your requested mode(here FULL_MODE). You can check the required code here.
I never change my mode. I observed this when I started getting runtime errors as I have fixed the fields that I need to receive and process.
Also i am not making any 'quote' call anywhere as tickers are active
below is my code.
def on_connect(ws, response):
tickerlog.info("Successfully connected. Response: {} {}".format(response,len(instrument_tokens)))
if len(instrument_tokens) > 0:
ws.subscribe(instrument_tokens)
ws.set_mode(ws.MODE_FULL, instrument_tokens)
tickerlog.info("Subscribe to tokens in Full mode: {}".format(instrument_tokens))