class: RabbitMqConsumer
[33:14] (extern: com.lehman.aussom.RabbitMqConsumer) extends: object
Synchronous pull consumer created with channel.consume(). The broker pushes deliveries into an internal buffer; receive() drains them one at a time on the calling thread. With manual acks (AutoAck false) plus qos(prefetch) on the channel, the broker never sends more than the prefetch window unacknowledged, so a slow consumer applies real back-pressure. Acknowledge through the received message (Msg.ack()) or the channel. Asynchronous push into callbacks goes through RabbitMqListener instead, which runs under the Aussom Server listener runtime.
Methods
-
RabbitMqConsumer ()
-
receive (
int TimeoutMs = 0)Receives the next message, blocking up to the timeout.
- @p
TimeoutMsis an int with how long to wait (default 0 = wait forever). - @r
ARabbitMqMessage object, or null when the timeout expires.
- @p
-
receiveNoWait ()
Returns the next message if one is buffered right now. Never blocks.
- @r
ARabbitMqMessage object, or null.
- @r
-
getConsumerTag ()
Gets the consumer tag (broker-assigned when none was provided to consume()).
- @r
Astring with the consumer tag.
- @r
-
isCancelled ()
Reports whether the broker cancelled this consumer from its side, for example because the queue was deleted.
- @r
Abool with true after a broker-side cancel.
- @r
-
cancel ()
Cancels the consumer. Buffered undispatched messages are requeued on the broker when the consumer was manual-ack. Safe to call more than once.
- @r
thisobject
- @r