Intermittent issue.

anandaravindan
In the past couple of days data is not streamed properly when using kiteconnectjs. Data resumes after 4 or 5 tries. Correct access token and public token is used and it is not an authentication or an authorization issue as it works when tried multiple times. There is no error just no data is available in the socket.

Please check.
  • sujith
    @anandaravindan,
    This shouldn't be happening after day before yesterday's fix. We will check and let you know.
  • anandaravindan
    @sujith Any update on this, it is still happening.
  • anandaravindan
    @sujith Can you update on this? This is making the service unusable, ticks stops very frequently and has socket has to be reconnected to resume the ticks
  • Vivek
    Vivek edited March 2017
    @anandaravindan we have tested it extensively and we couldn't reproduce the issue. If possible please share your code with us and we will try to debug it. We acknowledge that we had issue connecting to ticker last week but that has been resolved and should be working fine now.
  • anandaravindan
    anandaravindan edited March 2017
    @vivek I am not using raw web socket. I am using kiteconnectjs, and below is the gist
          function setTick(ticks) {
    ticks.forEach(function(tick) {
    tick.scrip = items[tick.Token];
    tick.exchange = 'NSE';
    deltaReceivedCount ++;
    quotePublisher.publish(tick);
    })
    };
    function subscribe() {
    var subscribe = Object.keys(items).map(function(val) { return parseInt(val) }); ;
    ticker.subscribe(subscribe);
    ticker.setMode(ticker.modeQuote, subscribe);
    }
    var KiteTicker = require("kiteconnect").KiteTicker;
    ticker = new KiteTicker(apiKey, userId, public_token);
    ticker.connect();
    ticker.on("tick", setTick);
    ticker.on("connect", subscribe);
  • Vivek
    @anandaravindan I have tested your code and it gets connected everytime I try connecting and I do get ticks without any issues. Please check your network and try testing it in remote server.

    Here is the code I have modified and tested.
    function setTick(ticks) {
    ticks.forEach(function(tick) {
    console.log("tick", tick)
    // tick.scrip = items[tick.Token];
    // tick.exchange = 'NSE';
    // deltaReceivedCount ++;
    // quotePublisher.publish(tick);
    })
    };
    function subscribe() {
    // var subscribe = Object.keys(items).map(function(val) { return parseInt(val) });
    var subscribe = [53359623] // subscribe to crudeoil march fut
    ticker.subscribe(subscribe);
    ticker.setMode(ticker.modeQuote, subscribe);
    }
    var KiteTicker = require("./lib/ticker");
    ticker = new KiteTicker("myapikey", "myuserid", "mypublic_token");
    ticker.connect();
    ticker.on("tick", setTick);
    ticker.on("connect", subscribe);
  • anandaravindan
    @vivek, I did isolate the issue, Its not an intermittent issue, I should rather say ticks are not frequent as it used to be. My health check fails which cause it to restart, I expect atleast 10 ticks for 10 seconds for 200 tokens but it doesn't seem to happen. But In reality it should be easily be 10 ticks for 10 seconds for scrips like RELIANCE, SBIN.
Sign In or Register to comment.