Class AMQConsumer


  • public class AMQConsumer
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AMQConsumer​(AMQSession amqSession, org.apache.activemq.command.ActiveMQDestination d, org.apache.activemq.command.ConsumerInfo info, java.util.concurrent.ScheduledExecutorService scheduledPool, boolean internalAddress)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void acknowledge​(org.apache.activemq.command.MessageAck ack)
      The acknowledgement in openwire is done based on intervals.
      void acquireCredit​(int n, boolean delivered)  
      void addRolledback​(org.apache.activemq.artemis.core.server.MessageReference messageReference)  
      void browseFinished()  
      org.apache.activemq.command.ConsumerId getId()  
      org.apache.activemq.command.ConsumerInfo getInfo()  
      org.apache.activemq.command.ActiveMQDestination getOpenwireDestination()  
      protected java.util.Set<org.apache.activemq.artemis.core.server.MessageReference> getRolledbackMessageRefs()  
      int handleDeliver​(org.apache.activemq.artemis.core.server.MessageReference reference, org.apache.activemq.artemis.api.core.ICoreMessage message)  
      void handleDeliverNullDispatch()  
      boolean hasCredits()  
      void init​(org.apache.activemq.artemis.core.server.SlowConsumerDetectionListener slowConsumerDetectionListener, long nativeId)  
      void processMessagePull​(org.apache.activemq.command.MessagePull messagePull)  
      void removeConsumer()  
      void removeRolledback​(org.apache.activemq.artemis.core.server.MessageReference messageReference)  
      void setPrefetchSize​(int prefetchSize)  
      boolean updateDeliveryCountAfterCancel​(org.apache.activemq.artemis.core.server.MessageReference ref)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AMQConsumer

        public AMQConsumer​(AMQSession amqSession,
                           org.apache.activemq.command.ActiveMQDestination d,
                           org.apache.activemq.command.ConsumerInfo info,
                           java.util.concurrent.ScheduledExecutorService scheduledPool,
                           boolean internalAddress)
    • Method Detail

      • getRolledbackMessageRefs

        protected java.util.Set<org.apache.activemq.artemis.core.server.MessageReference> getRolledbackMessageRefs()
      • init

        public void init​(org.apache.activemq.artemis.core.server.SlowConsumerDetectionListener slowConsumerDetectionListener,
                         long nativeId)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getId

        public org.apache.activemq.command.ConsumerId getId()
      • acquireCredit

        public void acquireCredit​(int n,
                                  boolean delivered)
      • handleDeliver

        public int handleDeliver​(org.apache.activemq.artemis.core.server.MessageReference reference,
                                 org.apache.activemq.artemis.api.core.ICoreMessage message)
      • handleDeliverNullDispatch

        public void handleDeliverNullDispatch()
      • acknowledge

        public void acknowledge​(org.apache.activemq.command.MessageAck ack)
                         throws java.lang.Exception
        The acknowledgement in openwire is done based on intervals. We will iterate through the list of delivering messages at ServerConsumer.scanDeliveringReferences(boolean, Function, Function) and add those to the Transaction. Notice that we will start a new transaction on the cases where there is no transaction.
        Throws:
        java.lang.Exception
      • browseFinished

        public void browseFinished()
      • getInfo

        public org.apache.activemq.command.ConsumerInfo getInfo()
      • hasCredits

        public boolean hasCredits()
      • processMessagePull

        public void processMessagePull​(org.apache.activemq.command.MessagePull messagePull)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeConsumer

        public void removeConsumer()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getOpenwireDestination

        public org.apache.activemq.command.ActiveMQDestination getOpenwireDestination()
      • setPrefetchSize

        public void setPrefetchSize​(int prefetchSize)
      • updateDeliveryCountAfterCancel

        public boolean updateDeliveryCountAfterCancel​(org.apache.activemq.artemis.core.server.MessageReference ref)
      • removeRolledback

        public void removeRolledback​(org.apache.activemq.artemis.core.server.MessageReference messageReference)
      • addRolledback

        public void addRolledback​(org.apache.activemq.artemis.core.server.MessageReference messageReference)