AnyEvent::RabbitMQ::Channel - Abstraction of an AMQP channel.
my $ch = $rf->open_channel(); $ch->declare_exchange(exchange => 'test_exchange');
open_channel
Callback invoked when the channel closes. Callback will be passed the incoming message that caused the close, if any.
Callback invoked when a mandatory or immediate message publish fails. Callback will be passed the incoming message, with accessors method_frame, header_frame, and body_frame.
method_frame
header_frame
body_frame
Declare an exchange (to publish messages to) on the server.
Arguments:
Default 'direct'
Default 0
The name of the exchange
Binds a queue to an exchange, with a routing key.
The name of the queue to bind
The name of the exchange to bind
The routing key to bind with
Flushes the contents of a queue.
Deletes a queue. The queue may not have any active consumers.
Publish a message to an exchange
The text body of the message to send.
Customer headers for the message (if any).
The name of the exchange to send the message to.
The routing key with which to publish the message.
Callback (if any) for confirming acknowledgment when in confirm mode.
Subscribe to consume messages from a queue.
Callback called with an argument of the message which has been consumed.
Callback called if consumption is canceled. This may be at client request or as a side effect of queue deletion. (Notification of queue deletion is a RabbitMQ extension.)
Identifies this consumer, will be auto-generated if you do not provide it, but you must supply a value if you want to be able to later cancel the subscription.
Callback called if the subscription was successful (before the first message is consumed).
Callback called if the subscription fails for any reason.
Publish a message to an exchange.
Hash of AMQP message header info, including the confusingly similar element "headers", which may contain arbitrary string key/value pairs.
Message body.
Boolean; if true, then if the message doesn't land in a queue (e.g. the exchange has no bindings), it will be "returned." (see "on_return")
Boolean; if true, then if the message cannot be delivered directly to a consumer, it will be "returned." (see "on_return")
Callback called with the frame that acknowledges receipt (if channel is in confirm mode), typically Net::AMQP::Protocol::Basic::Ack.
Callback called with the frame that declines receipt (if the channel is in confirm mode), typically Net::AMQP::Protocol::Basic::Nack or Net::AMQP::Protocol::Channel::Close.
In AMQP, a "returned" message is one that cannot be delivered in compliance with the immediate or mandatory flags.
immediate
mandatory
If in confirm mode, this callback will be called with the frame that reports message return, typically Net::AMQP::Protocol::Basic::Return. If confirm mode is off or this callback is not provided, then the channel or connection objects' on_return callbacks (if any), will be called instead.
NOTE: If confirm mode is on, the on_ack or on_nack callback will be called whether or not on_return is called first.
Cancel a queue subscription.
Note that the cancellation will not take place at once, and further messages may be consumed before the subscription is cancelled. No further messages will be consumed after the on_success callback has been called.
Identifies this consumer, needs to be the value supplied when the queue is initially consumed from.
Callback called if the subscription was successfully cancelled.
Callback called if the subscription could not be cancelled for any reason.
Try to get a single message from a queue.
Mandatory. Name of the queue to try to receive a message from.
Will be called either with either a message, or, if the queue is empty, a notification that there was nothing to collect from the queue.
This callback will be called if an error is signalled on this channel.
Put channel into confirm mode. In confirm mode, publishes are confirmed by the server, so the on_ack callback of publish works.
See AnyEvent::RabbitMQ for author(s), copyright and license.
To install AnyEvent::RabbitMQ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::RabbitMQ
CPAN shell
perl -MCPAN -e shell install AnyEvent::RabbitMQ
For more information on module installation, please visit the detailed CPAN module installation guide.