webcerebrium / java-binance-api

Java Binance API Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web Socket - No Output

spapapan opened this issue · comments

I am trying to run:

		BinanceSymbol symbol = new BinanceSymbol("ETHBTC");
		Session session = (new BinanceApi()).websocketTrades(symbol, new BinanceWebSocketAdapterAggTrades() {
		    @Override
		    public void onMessage(BinanceEventAggTrade message) { 
		        System.out.println(message.toString());
		    }
		});
		try { Thread.sleep(5000); } catch (InterruptedException e) {}
		session.close();

But I don't get any output. There are no errors and the program never stop. Is this somehow my fault?

That just means nothing happened during those 5 seconds on that particular market.
Try increasing time interval or even remove the last 2 lines - it will watch market till the user interrupts it

That's not the case. I have tried it many times and I checked the market. I also tried the other class BinanceWebSocketAdapterDepth but still I don't get anything back.

well, I've double checked the code is valid, I've added it as groovy example and it works for me.
May me it is somehow connected with dependencies managed manually like described in your previous ticket