CoreSubscription sub = (CoreSubscription)channel; sub.closeConsumer();
Subscription sub = (Subscription)channel; try { if (!sub.isRecoverable()) {  sub.disconnect(); } } catch (Exception e) { throw new MessagingJMSException("Failed to disconnect", e); }
   public void close() throws JMSException   {      if (closed)      {         throw new IllegalStateException("Consumer is already closed");      }      if (trace) { log.trace(this + " close"); }      closed = true;      // On close we only disconnect the consumer from the Channel we don't actually remove it      // This is because it may still contain deliveries that may well be acknowledged after      // the consumer has closed. This is perfectly valid.      disconnect();      JMSDispatcher.instance.unregisterTarget(new Integer(id));            //Remove the subscription if non durable      if (channel instanceof CoreSubscription)      {         CoreSubscription sub = (CoreSubscription)channel;         sub.closeConsumer();               }              }