@Override
public void processMessage(String messageText) {
// Parse the message
JsonMessage jsonMessage = JsonMessageMapper.fromString(messageText);
logger.debug("Received message:\n{}", JsonMessageMapper.toFormattedString(jsonMessage));
// Dispatch to the correct handler
if (jsonMessage.getClass().equals(NewOrderSingle.class)) {
this.onMessage((NewOrderSingle)jsonMessage);
}
else if (jsonMessage.getClass().equals(OrderCancelRequest.class)) {
this.onMessage((OrderCancelRequest)jsonMessage);
}
}