ConnectionState connectionState = (ConnectionState) sessionState.getParent();
sessionState.removeCallbackHandler(consumerState.getClientConsumer());
CallbackManager cm = connectionState.getRemotingConnection().getCallbackManager();
cm.unregisterHandler(consumerState.getConsumerID());
//And then we cancel any messages still in the message callback handler buffer
consumerState.getClientConsumer().cancelBuffer();
sessionState.getExecutor().clearClassLoader();