Btstamp Websocket API v2 Java client
Java client for Bitstamp's Websocket API v2. Makes use of dsl-json and tyrus.
This can be run in stand-alone mode for orders or trades. Running the below
will result in a logfile with the format pair-type-YYYY-MM-DD.csv, Change
pair for the market, type as either orders or trades.
The logfiles will rotate each day (UTC),
./run.sh btusd ordersor
./run.sh btusd tradesSee Client interface.
For example, to stream limit orders for btcusd:
// 1. Specify a message handler
Client client = new BitstampClient();
BitstampMessageHandler<OrderEvent> orderHandler = order -> System.out.println(order);
// 2. Subscribe to channel
String subscriptionId = client.subscribeOrders("btcusd", orderHandler);
// 3. Close channel
client.unsubscribe(subscriptionId)Example here.
It is expected that the message handler puts the message on a non-blocking queue or similar (performs minimal work).