Evening all,
I'm having some trouble with the Stream API not returning an initial image for some of my subscriptions.
I'm connecting to the API with the below function:
async connect() {
const APIKey = betfairAPIClient.getAPIKey();
const sessionToken = await betfairAPIClient.getSessionToken();
/* Socket connection options */
const options = { host: 'stream-api.betfair.com', port: 443 }
/* Establish connection to the socket */
this.client = tls.connect(options);
/* Send authentication message */
this.client.write('{"op": "authentication", "appKey": "' + APIKey + '", "session": "' + sessionToken + '"}\r\n');
this.client.on('data', this.onData.bind(this));
this.client.on('close', this.onClose.bind(this));
this.client.on('error', this.onError.bind(this));
}
And subscribing with this:
const marketSub = {
op: "marketSubscription",
id: id,
marketFilter: { marketIds: [market] },
marketDataFilter: { fields: ["EX_ALL_OFFERS"], ladderLevels: 3 },
};
this.client.write(JSON.stringify(marketSub) + '\r\n');
This works fine when subscribing to just one market, but when subscribing to multiple markets (currently 6) by sending 6 different subscription messages I receive success messages for all 6, but SUB_IMAGE messages for only a few.
The SUM_IMAGEs received vary, but are commonly just numbers 5 and 6, and I rarely if ever receive number 1.
I receive no errors and have confirmed that every message is being acted on with Wireshark.
Is there some kind of rate limit for subscriptions that I'm violating?
I'm having some trouble with the Stream API not returning an initial image for some of my subscriptions.
I'm connecting to the API with the below function:
async connect() {
const APIKey = betfairAPIClient.getAPIKey();
const sessionToken = await betfairAPIClient.getSessionToken();
/* Socket connection options */
const options = { host: 'stream-api.betfair.com', port: 443 }
/* Establish connection to the socket */
this.client = tls.connect(options);
/* Send authentication message */
this.client.write('{"op": "authentication", "appKey": "' + APIKey + '", "session": "' + sessionToken + '"}\r\n');
this.client.on('data', this.onData.bind(this));
this.client.on('close', this.onClose.bind(this));
this.client.on('error', this.onError.bind(this));
}
And subscribing with this:
const marketSub = {
op: "marketSubscription",
id: id,
marketFilter: { marketIds: [market] },
marketDataFilter: { fields: ["EX_ALL_OFFERS"], ladderLevels: 3 },
};
this.client.write(JSON.stringify(marketSub) + '\r\n');
This works fine when subscribing to just one market, but when subscribing to multiple markets (currently 6) by sending 6 different subscription messages I receive success messages for all 6, but SUB_IMAGE messages for only a few.
The SUM_IMAGEs received vary, but are commonly just numbers 5 and 6, and I rarely if ever receive number 1.
I receive no errors and have confirmed that every message is being acted on with Wireshark.
Is there some kind of rate limit for subscriptions that I'm violating?


Comment