Class | AMQP::Consumer |
In: |
lib/amqp/consumer.rb
|
Parent: | AMQ::Client::Async::Consumer |
AMQP consumers are entities that handle messages delivered to them ("push API" as opposed to "pull API") by AMQP broker. Every consumer is associated with a queue. Consumers can be exclusive (no other consumers can be registered for the same queue) or not (consumers share the queue). In the case of multiple consumers per queue, messages are distributed in round robin manner with respect to channel-level prefetch setting).
@see AMQP::Queue @see AMQP::Queue#subscribe @see AMQP::Queue#cancel
arguments | [R] | @return [Hash] Custom subscription metadata |
channel | [R] | @return [AMQP::Channel] Channel this consumer uses |
consumer_tag | [R] | @return [String] Consumer tag, unique consumer identifier |
queue | [R] | @return [AMQP::Queue] Queue messages are consumed from |
@param [AMQ::Client::ConsumerTagGenerator] Assigns consumer tag generator that will be used by consumer instances @return [AMQ::Client::ConsumerTagGenerator] Provided argument
Acknowledge a delivery tag. @return [Consumer] self
@api public @see bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.8.3.13.)
Called by associated connection object when AMQP connection has been re-established (for example, after a network failure).
@api plugin
Begin consuming messages from the queue @return [AMQP::Consumer] self
@return [Boolean] true if this consumer is exclusive (other consumers for the same queue are not allowed)
Register a block that will be used to handle delivered messages.
@return [AMQP::Consumer] self @see AMQP::Queue#subscribe
@return [Consumer] self
@api public @see bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.8.3.14.)
{AMQP::Queue} API compatibility.
@return [Boolean] true if this consumer is active (subscribed for message delivery) @api public