XChange icon indicating copy to clipboard operation
XChange copied to clipboard

[Binance][Streaming] Binance trades streaming doesn't work

Open Flamarial opened this issue 4 years ago • 4 comments

Version: 5.0.7

I've encountered some trouble with streaming Binance. I subscribe at connect time with a ProductSubscription,. but I don't seem to be getting any messages through at all via subscribe(). I'm running the most basic example in Android:

new Thread(() -> {
            ExchangeSpecification spec = StreamingExchangeFactory.INSTANCE.createExchange(BinanceStreamingExchange.class).getDefaultExchangeSpecification();
            BinanceStreamingExchange exchange = (BinanceStreamingExchange) StreamingExchangeFactory.INSTANCE.createExchange(spec);

            ProductSubscription subscription = ProductSubscription.create().addTrades(CurrencyPair.BTC_USDT).build();
            exchange.connect(subscription).blockingAwait();
            exchange.getStreamingMarketDataService()
                    .getTrades(CurrencyPair.BTC_USDT)
                    .subscribe(trade -> {
                        Log.i(TAG, "Trade: " + trade);
                    });
        }).start();

The same exact code refactored with KrakenStreamingExchange works 100% fine. Likewise, directly subscribing to the Binance WebSockets API without the use of this library works fine as well.

Flamarial avatar Apr 24 '21 23:04 Flamarial

The same here. I tried Bitfinex, CoinbasePro, Kraken etc. and everywhere I am getting messages. But from Binance nothing. There is just message: Subscribing to channel btcusd@trade and then nothing

M1K avatar Sep 18 '21 06:09 M1K

same here

n-dragon avatar Dec 16 '21 20:12 n-dragon

Same problem here

Svenmet avatar Feb 26 '22 17:02 Svenmet

It's working, at least with latest 5.0.14-SNAPSHOT version.

mrmx avatar Jun 26 '22 14:06 mrmx