This repository was archived by the owner on Jun 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 215
This repository was archived by the owner on Jun 8, 2020. It is now read-only.
[bitflyer] Websocket api did not work properly #413
Copy link
Copy link
Open
Labels
Description
I'm just running the test code, which is BitflyerManualExample, and it seems not working at all.
import info.bitrich.xchangestream.core.StreamingExchange;
import info.bitrich.xchangestream.core.StreamingExchangeFactory;
import org.knowm.xchange.currency.CurrencyPair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created by Lukas Zaoralek on 14.11.17.
*/
public class BitflyerManualExample {
private static final Logger LOG = LoggerFactory.getLogger(BitflyerManualExample.class);
public static void main(String[] args) {
StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(BitflyerStreamingExchange.class.getName());
exchange.connect().blockingAwait();
//Note that, the receiving first order book snapshot takes several seconds or minutes!
exchange.getStreamingMarketDataService().getOrderBook(CurrencyPair.BTC_JPY).subscribe(orderBook -> {
LOG.info("First ask: {}", orderBook.getAsks().get(0));
LOG.info("First bid: {}", orderBook.getBids().get(0));
}, throwable -> LOG.error("ERROR in getting order book: ", throwable));
exchange.getStreamingMarketDataService().getTicker(CurrencyPair.BTC_JPY).subscribe(ticker -> {
LOG.info("TICKER: {}", ticker);
}, throwable -> LOG.error("ERROR in getting ticker: ", throwable));
exchange.getStreamingMarketDataService().getTrades(CurrencyPair.BTC_JPY)
.subscribe(trade -> LOG.info("TRADE: {}", trade),
throwable -> LOG.error("ERROR in getting trades: ", throwable));
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}result output is:
2019-09-27 16:44:04,721 main ERROR Property contains invalid attributes "scope", "source"
[2019-09-27 16:44:07:703] INFO [main] (info.bitrich.xchangestream.service.pubnub.PubnubStreamingService:) - Subscribing to channel lightning_board_snapshot_BTC_JPY.
[2019-09-27 16:44:07:969] INFO [main] (info.bitrich.xchangestream.service.pubnub.PubnubStreamingService:) - Subscribing to channel lightning_board_BTC_JPY.
[2019-09-27 16:44:08:239] INFO [main] (info.bitrich.xchangestream.service.pubnub.PubnubStreamingService:) - Subscribing to channel lightning_ticker_BTC_JPY.
[2019-09-27 16:44:08:247] INFO [main] (info.bitrich.xchangestream.service.pubnub.PubnubStreamingService:) - Subscribing to channel lightning_executions_BTC_JPY.