Hey,
I am having an issue with the library at binance-futures-connector-java
I am using the latest 3.0.1
I created a listen key from my API key. The listen key is correct and functional, I did a long chat with binance support, they verified it as well and I also checked the demo endpoint at Websocket Demo The mode endpoint works with the same listen key
My code is pretty much taken from the example at ListenUserStream.java
I am using the same library and similar code for the price book stream and it works fine.
Here is my test code that does not work with USER streams:
UMFuturesClientImpl client = new UMFuturesClientImpl(tradeKey, tradeSecret, DefaultUrls.USDM_PROD_URL);
UMWebsocketClientImpl websocketClient = new UMWebsocketClientImpl(DefaultUrls.USDM_WS_URL);
String listenKey = client.userData().createListenKey();
System.out.println("Listen key: " + listenKey);
int Id = websocketClient.listenUserStream(listenKey, Scratch::receiveMessageJSON);
Thread.sleep(15000);
websocketClient.closeConnection(Id);
private static void receiveMessageJSON(String data) {
JSONObject obj = new JSONObject(data);
System.out.println(obj);
}
I run the code, I see the following printed on the console
20:00:40.204 [main] INFO c.b.c.f.client.utils.RequestHandler - POST removed
Listen key: {“listenKey”:“hidden”}
20:00:40.835 [main] INFO c.b.c.f.c.utils.WebSocketConnection - [Connection 1] Connecting to removed
20:00:42.216 [OkHttp removed…] INFO c.b.c.f.c.utils.WebSocketConnection - [Connection 1] Connected to Server
Then, I try something like opening a small position on ETHUSDT or doing a transfer from my futures account. No event comes, nothing is printed on the console, the method receiveMessageJSON is never called.
I had to remove the links from my post, because of new user restrictions