cons.cancelMessage(id);
cons.cancelDelivery(id);
   public static void callOnMessage(ConsumerDelegate cons,                                    SessionDelegate sess,                                    MessageListener listener,                                    int consumerID,                                    boolean isConnectionConsumer,                                    MessageProxy m,                                    int ackMode)         throws JMSException   {      preDeliver(sess, consumerID, m, isConnectionConsumer);                          try      {               listener.onMessage(m);               }      catch (RuntimeException e)      {         long id = m.getMessage().getMessageID();         log.error("RuntimeException was thrown from onMessage, " + id + " will be redelivered", e);                  //See JMS1.1 spec 4.5.2         if (ackMode == Session.AUTO_ACKNOWLEDGE || ackMode == Session.DUPS_OK_ACKNOWLEDGE)         {            //Cancel the message - this means it will be immediately redelivered            if (trace) { log.trace("cancelling " + id); }            cons.cancelMessage(id);         }         else         {            // Session is either transacted or CLIENT_ACKNOWLEDGE            // We just deliver next message            if (trace) { log.trace("ignoring exception on " + id); }         }      }                  postDeliver(sess, consumerID, m, isConnectionConsumer);             }