This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Description
I'm using the lib with Spring. So I used a bean to initiate the WebSocket connection.
@Configuration
public class WebSocketConfig {
@Autowired
OperationParametersDTO operationParametersDTO;
@Bean
public BinanceApiWebSocketClient binanceApiWebSocketClient() {
BinanceApiWebSocketClient bean = BinanceApiClientFactory.newInstance().newWebSocketClient();
bean.onCandlestickEvent(operationParametersDTO.getOperationPair().toLowerCase(),
CandlestickInterval.ONE_MINUTE,
new BinanceApiCallback<CandlestickEvent>() {
@Override
public void onResponse(CandlestickEvent ce) {
System.out.println(ce);
}
}
);
return bean;
}
}
However, when I close the connection, it keeps listening to events.
`
// ... closer controller logic
binanceApiWebSocketClient.close();
binanceApiWebSocketClient = null;
//... closer controller logic
`
Am I doing something wrong here?