Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

[bitflyer] Websocket api did not work properly #413

Open
googya opened this issue Sep 27, 2019 · 1 comment
Open

[bitflyer] Websocket api did not work properly #413

googya opened this issue Sep 27, 2019 · 1 comment
Labels

Comments

@googya
Copy link

googya commented Sep 27, 2019

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.
@googya googya changed the title bitflyer api did not work properly bitflyer websocket api did not work properly Sep 27, 2019
@badgerwithagun badgerwithagun changed the title bitflyer websocket api did not work properly [bitflyer] Websocket api did not work properly Dec 6, 2019
@badgerwithagun
Copy link
Collaborator

Does indeed sound like a bug. Anyone using bitflyer?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants