Is there any issue in Market Data Feeder V3. Today getting error in websocket
@Ushnota Below is my code.
async function initProtobuf() {
// protobufRoot = await protobuf.load(__dirname + ā/MarketDataFeed.protoā);
protobufRoot = await protobuf.load(__dirname + ā/MarketDataFeedV3.protoā);
console.log(āProtobuf part initialization completeā);
}
function decodeProfobuf(buffer) {
if (protobufRoot == null) {
console.warn(āProtobuf part not initialized yet!ā);
return null;
}
// const FeedResponse = protobufRoot.lookupType(ācom.upstox.marketdatafeeder.rpc.proto.FeedResponseā);
const FeedResponse = protobufRoot.lookupType(ācom.upstox.marketdatafeederv3udapi.rpc.proto.FeedResponseā);
return FeedResponse.decode(buffer);
}
ws.on(āmessageā, (data) => {
this.isWebMessageReceived = true;
if (data) {
console.log(data);
const jsonData = decodeProfobuf(data);
// if (jsonData) {
// this.processData(jsonData);
// }
}
});
V2 working fine but in V3 when decodingData in websocket message getting below error.
throw indexOutOfRange(this, length);
^
RangeError: index out of range: 62 + 4 > 62
at indexOutOfRange (E:\NodeJS\AutoTradeNode\node_modules\protobufjs\src\reader.js:13:12)
at BufferReader.skip (E:\NodeJS\AutoTradeNode\node_modules\protobufjs\src\reader.js:343:19)
at Reader.skipType (E:\NodeJS\AutoTradeNode\node_modules\protobufjs\src\reader.js:377:18)
at Type.FeedResponse$decode [as decode] (eval at Codegen (E:\NodeJS\AutoTradeNode\node_modules@protobufjs\codegen\index.js:50:33), :44:5)
at decodeProfobuf (E:\NodeJS\AutoTradeNode\functions\strategyOne.js:182:23)
at WebSocket. (E:\NodeJS\AutoTradeNode\functions\strategyOne.js:239:28)
at WebSocket.emit (node:events:520:28)
at Receiver.receiverOnMessage (E:\NodeJS\AutoTradeNode\node_modules\ws\lib\websocket.js:1220:20)
at Receiver.emit (node:events:520:28)
at Receiver.dataMessage (E:\NodeJS\AutoTradeNode\node_modules\ws\lib\receiver.js:569:14)
at E:\NodeJS\AutoTradeNode\node_modules\ws\lib\receiver.js:530:12
at E:\NodeJS\AutoTradeNode\node_modules\ws\lib\permessage-deflate.js:309:9
at E:\NodeJS\AutoTradeNode\node_modules\ws\lib\permessage-deflate.js:392:7
at afterWrite (node:internal/streams/writable:701:5)
at onwrite (node:internal/streams/writable:679:7)
at Zlib.cb (node:internal/streams/transform:191:7)
@Ushnota @MohitGolecha There is around 3-5 minutes delay in ws feed after subscribing to the instruments. Can you please check it?
Hi @adhil_a_backer,
We are checking this. Will get back to you in a bit, thanks.
Yes, it is not working for me either. It used to work flawlessly since I started using the Upstox API a few days ago, up until 11 AM today, when it went haywire. Iāve been banging my head against the wall trying to fix it ever since. Right now, Iām either getting no data or very few data points. Could you please check if there are any issues on your end? If not, Iāll try to fix it from my side and appreciate your help with troubleshooting.
I find only this error and then it reconnected
2025-02-10 11:06:06 ERROR Status Code:1006 reason:
Hello @Abhishek_Panigrahi,
Welcome to the Upstox Community!
We are checking this and will get back to you soon. Thanks.
@dhruvgangani1, @adhil_a_backer, and @Abhishek_Panigrahi ā We had a cache-related issue around 11 AM, which has now been resolved. Thanks for your understanding.
@shanmu, I used to get approx. 16-17k ticks a minute currently getting 3-4k ticks.
Hello guys,
Please change MarketDataFeedV3.proto file. Yesterday it was changed. After updating it the latest it is working fine. Link shared below.
Iāve updated it, still faced issue at the morning. And currently the frequency of data was very low.
After 11:30, I got a descent amount of data.
Last week, I used to get 16-17k tick a minute
From the morning till 11:30 - There was no data or 2-3k
Currently - Iām getting 11-13k ticks.
Is the frequency of data streaming reduced ? @shanmu
No, thereās no change in the planned frequency. However, we did encounter an issue with the sockets, which the team is working on. A fix is expected later today. Iāll drop a note here once itās patched.
Thanks!
@Abhishek_Panigrahi - The patch is deployed. Let us know if you still encounter the issue. Thanks!