Class AmqpConsumer

    • Field Detail

      • acknowledgementMode

        protected final int acknowledgementMode
      • incomingSequence

        protected long incomingSequence
      • deliveredCount

        protected int deliveredCount
      • dispatchedCount

        protected int dispatchedCount
      • deferredClose

        protected boolean deferredClose
    • Constructor Detail

      • AmqpConsumer

        public AmqpConsumer​(AmqpSession session,
                            JmsConsumerInfo info,
                            org.apache.qpid.proton.engine.Receiver receiver)
    • Method Detail

      • start

        public void start​(AsyncResult request)
        Starts the consumer by setting the link credit to the given prefetch value.
        Parameters:
        request - The request that awaits completion of the consumer start.
      • stop

        public void stop​(AsyncResult request)
        Stops the consumer, using all link credit and waiting for in-flight messages to arrive.
        Parameters:
        request - The request that awaits completion of the consumer stop.
      • acknowledge

        public void acknowledge​(ProviderConstants.ACK_TYPE ackType)
        Called to acknowledge all messages that have been marked as delivered but have not yet been marked consumed. Usually this is called as part of an client acknowledge session operation. Only messages that have already been acknowledged as delivered by the JMS framework will be in the delivered Map. This means that the link credit would already have been given for these so we just need to settle them.
        Parameters:
        ackType - the type of acknowledgement to perform
      • acknowledge

        public void acknowledge​(JmsInboundMessageDispatch envelope,
                                ProviderConstants.ACK_TYPE ackType)
        Called to acknowledge a given delivery.
        Parameters:
        envelope - the delivery that is to be acknowledged.
        ackType - the type of acknowledgement to perform.
      • recover

        public void recover()
                     throws java.lang.Exception
        Recovers all previously delivered but not acknowledged messages.
        Throws:
        java.lang.Exception - if an error occurs while performing the recover.
      • pull

        public void pull​(long timeout,
                         AsyncResult request)
        Request a remote peer send a Message to this client. timeout < 0 then it should remain open until a message is received. timeout = 0 then it returns a message or null if none available timeout > 0 then it should remain open for timeout amount of time. The timeout value when positive is given in milliseconds.
        Parameters:
        timeout - the amount of time to tell the remote peer to keep this pull request valid.
        request - the asynchronous request object waiting to be notified of the pull having completed.
      • getNextIncomingSequenceNumber

        protected long getNextIncomingSequenceNumber()
      • closeOrDetachEndpoint

        protected void closeOrDetachEndpoint()
        Description copied from class: AmqpAbstractResource
        Perform the close operation on the managed endpoint. A subclass may override this method to alter the standard close path such as endpoint detach etc.
        Overrides:
        closeOrDetachEndpoint in class AmqpAbstractResource<JmsConsumerInfo,​org.apache.qpid.proton.engine.Receiver>
      • isStopping

        public boolean isStopping()
      • getDrainTimeout

        public int getDrainTimeout()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • deliver

        protected void deliver​(JmsInboundMessageDispatch envelope)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • preCommit

        public void preCommit()
      • preRollback

        public void preRollback()
      • postCommit

        public void postCommit()
      • postRollback

        public void postRollback()