consumerState.getMessageCallbackHandler().cancelBuffer();
   public Object handleClosing(Invocation invocation) throws Throwable   {            ConsumerState consumerState = getState(invocation);            // First we call close on the messagecallbackhandler which waits for onMessage invocations            // to complete and then cancels anything in the client buffer.      // any further messages received will be ignored      consumerState.getMessageCallbackHandler().close();            long lastDeliveryId = consumerState.getMessageCallbackHandler().getLastDeliveryId();            SessionState sessionState = (SessionState)consumerState.getParent();      ConnectionState connectionState = (ConnectionState)sessionState.getParent();                       sessionState.removeCallbackHandler(consumerState.getMessageCallbackHandler());      CallbackManager cm = connectionState.getRemotingConnection().getCallbackManager();      cm.unregisterHandler(consumerState.getConsumerID());                  // Then we make sure closing is called on the ServerConsumerEndpoint.      Object res = invocation.invokeNext();            //Now we send a message to the server consumer with the last delivery id so      //it can cancel any inflight messages after that      //This needs to be done *after* the call to closing has been executed on the server      //maybe it can be combined with closing            ConsumerDelegate del = (ConsumerDelegate)invocation.getTargetObject();               del.cancelInflightMessages(lastDeliveryId);                                         return res;   }      