Unsubscribe of tokens not working

pankaj8932
pankaj8932 edited March 2022 in Java client
Here I have subscribed to list of tokens say 3. When I am unsubscribing tokens, it doesn't unsubscribe. Here is the simple code, its not full code.

KiteTicker tickerProvider = new KiteTicker(kiteConnect.getAccessToken(), kiteConnect.getApiKey());
tickerProvider.connect(); // Now I got list of token results from server after subscribing it on onConnected() method.

tickerProvider.unsubscribe(tokens); // Here it doesn't unsubscribe

I also did disconnect but after reconnect it still gives all token results. I had to wait around 2 to 5 min after disconnect in order to unsubscribe it.

Is it a bug from your side? Please let me know.
  • SRIJAN
    SRIJAN edited March 2022
    No, unsubscribe and subscribe methods are working fine. Try printing subscribed tokens after unsubscribing to check.
  • pankaj8932
    I already had done this ... as I mentioned I also have disconnect and reconnect even though it gives subscribed token results ... not sure if this has been tested correctly. I am getting market depth value as blank using tick.getMarketDepth() method other values i am getting.
  • SRIJAN
    Market depth is only available in full mode. You can read about websocket and the different modes here:
    https://kite.trade/docs/connect/v3/websocket/
  • SRIJAN
    Also, unsubscribe would only work if the given tokens have been subscribed first.
  • Dileep
    Try printing subscribed tokens after unsubscribing to check.
    Hi.. @SRIJAN/@pankaj8932 can you give sample code to print subscribed tokens after un subscribing.
Sign In or Register to comment.