XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
The WebSocket connection and message communication are working fine, but an issue arises when handling the data. The subscription ID and the parameters being passed in the handleChannelMessage method don't match.
Log Information:
The subscription ID in the log shows:
Relevant Code Snippet:
The handleChannelMessage method is where the message is processed, but it doesn’t seem to handle the subscription parameters correctly:
protected void handleChannelMessage(String channel, T message) {
if (channel == null) {
LOG.debug("Channel provided is null");
return;
}
NettyStreamingService<T>.Subscription subscription = channels.get(channel);
if (subscription == null) {
LOG.debug("Channel has been closed {}.", channel);
return;
}
ObservableEmitter<T> emitter = subscription.emitter;
if (emitter == null) {
LOG.debug("No subscriber for channel {}.", channel);
return;
}
emitter.onNext(message);
}
Expected Behavior:
The subscription ID and the parameters passed to handleChannelMessage should match to ensure that the message is processed correctly.
The WebSocket connection and message communication are working fine, but an issue arises when handling the data. The subscription ID and the parameters being passed in the
handleChannelMessage
method don't match.Log Information: The subscription ID in the log shows:
However, in the
handleChannelMessage
method, the parameter being passed is:The parameters do not align, which may cause issues in processing the data.
Log Snippet:
Code: The following is the code where the subscription and message handling are taking place:
Relevant Code Snippet: The
handleChannelMessage
method is where the message is processed, but it doesn’t seem to handle the subscription parameters correctly:Expected Behavior: The subscription ID and the parameters passed to
handleChannelMessage
should match to ensure that the message is processed correctly.