bitrich-info / xchange-stream

XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol. It is build on top of of XChange library providing new interfaces for streaming API. User can subscribe for live updates via reactive streams of RxJava library.
Apache License 2.0
413 stars 222 forks source link

Add subscription to heartbeat channel on GDAX #66

Open chuggol opened 6 years ago

chuggol commented 6 years ago

I was not able to make GDAX trade subscription sustainable - for me it terminates every other day without any indication - websocket does not disconnect. You can emulate this by disconnecting the network after initial subscription has been established.

Checking if I've received any messages in the last n seconds would work, but seems hacky.

GDAX API docs indicate there is heartbeat channel to verify that connection is healthy, would be great to have that implemented. https://docs.gdax.com, search for 'heartbeat'

dozd commented 6 years ago

There is a new isAlive method in the streaming service - does it work?

Heartbeat pattern seems nice but someone need to make a research whether it's commonly supported feature by exchanges or GDAX is the only one.

nihiluis commented 6 years ago

I get the same disconnects. Some callback on disconnect would be appropriate. I think there also was some PR for automatic reconnect?