Exchange heartbeat subscriptions (streaming)
See original GitHub issueHaving an issue with CoinbasePro where disconnects on the web socket were getting triggered every so often after some period of inactivity (this due to the fact that on my user channel I don’t produce too many trades so messages can be sparse).
I solved this by effectively copying out CoinbaseProStreamingService.java
amongst other classes to subscribe to CoinbasePro’s heartbeat channel which receives heartbeats once a second and prevents web socket from dying.
I am now seeing a similar issue with Bitstamp (albeit not as frequently) on their regular trades channel with some symbols. Bitstamp does not have a heartbeat channel but suggests using web sockets ping pong mechanism. Sending a way to send a non text based web socket frame is not exposed in the NettyStreamingService.java
class.
In short, I would like to make two changes (or more) to the library:
1). Allow users the ability to subscribe to heartbeat channel as an exchange spec config for CoinbasePro (or have it by default subscribe by don’t pass heartbeat messages back to user of class-- Kraken does this).
2). Either expose method in NettyStreamingService.java
to write non text based messages or just a ping method so that users can trigger web socket ping with some interval.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
There are only two exchanges that override it Lgo + Gemini, but the override does the same thing as the feature we just added.
Only thing is that now client exchanges need to call super to avoid losing the ping/pong behaviour. Have you checked that there aren’t any doing so?