Crixa::Message - A Crixa Message
version 0.11
This class represents a single queue. With RabbitMQ, messages are published to exchanges, which then routes the message to one or more queues. You then consume those messages from the queue.
This class provides the following methods:
This send an acknowledgement for the message on the channel that was used to receive the message.
This returns the message's body. If the message does not have any content-encoding set _or_ the message contains an encoding with the string "utf-8" (case insensitive), then the message is returned as character data. Otherwise it is returned as binary data.
There are a number of properties that can be associated with a message. This class provides reader and predicate methods for all properties of the form $message->foo and $message->has_foo. None of the properties are required.
$message->foo
$message->has_foo
The properties supported are:
content_type
content_encoding
correlation_id
reply_to
expiration
message_id
type
user_id
app_id
priority
delivery_mode
timestamp
headers
See the publish method in the Crixa::Exchange docs for more details.
publish
A boolean indicating whether or not the message has already been delivered at least once. RabbitMQ guarantees that each message will be delivered at least once, and it is not uncommon for a message to be redelivered before the first consumer to receive it has had a chance to acknowledge it.
The number of messages left in the queue at the time this message was delivered.
Note that this is only set for messages which are not received via the Crixa::Queue->consume() method.
Crixa::Queue->consume()
The routing path on which the message was received.
The exchange to which this message was published
The delivery tag for a given message. This is used when the $message->ack() method is called.
$message->ack()
The tag for the consumer associated with the message, if one exists.
Note that this is only set for messages which are received via the Crixa::Queue->consume() method.
There is no reason to call this method directly. It will be called by a Crixa::Queue object to inflate messages into objects.
Chris Prather <chris@prather.org>
Dave Rolsky <autarch@urth.org>
This software is copyright (c) 2012 - 2015 by Chris Prather.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Crixa, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crixa
CPAN shell
perl -MCPAN -e shell install Crixa
For more information on module installation, please visit the detailed CPAN module installation guide.