Qpid Proton C++
0.12.1
|
An AMQP message. More...
#include <message.hpp>
Public Types | |
typedef std::map< std::string, scalar > | property_map |
A map of string keys and AMQP scalar values. | |
typedef std::map < annotation_key, value > | annotation_map |
A map of AMQP annotation keys and AMQP values. | |
Public Member Functions | |
message () | |
Create an empty message. | |
message (const message &) | |
Copy a message. | |
template<class T > | |
message (const T &x) | |
Create a message with its body set from any value that can be assigned to a proton::value. More... | |
message & | operator= (const message &) |
Copy a message. | |
Basic properties and methods | |
void | clear () |
Clear the message content and properties. | |
void | id (const message_id &id) |
message_id | id () const |
void | encode (std::vector< char > &bytes) const |
Encode entire message into a byte vector, growing it if necessary. More... | |
std::vector< char > | encode () const |
Return encoded message as a byte vector. | |
void | decode (const std::vector< char > &bytes) |
Decode from string data into the message. | |
Routing | |
void | address (const std::string &addr) |
std::string | address () const |
void | reply_to (const std::string &addr) |
std::string | reply_to () const |
void | correlation_id (const message_id &) |
message_id | correlation_id () const |
Content | |
template<class T > | |
void | body (const T &v) |
Set the body, equivalent to body() = v. | |
const value & | body () const |
Get the body. | |
value & | body () |
Get a reference to the body that can be modified in-place. | |
void | subject (const std::string &s) |
std::string | subject () const |
void | content_type (const std::string &s) |
std::string | content_type () const |
void | content_encoding (const std::string &s) |
std::string | content_encoding () const |
void | expiry_time (amqp_timestamp t) |
amqp_timestamp | expiry_time () const |
void | creation_time (amqp_timestamp t) |
amqp_timestamp | creation_time () const |
bool | inferred () const |
Get the inferred flag for a message. More... | |
void | inferred (bool) |
Set the inferred flag for a message. | |
Transfer headers | |
bool | durable () const |
Get the durable flag for a message. More... | |
void | durable (bool) |
Set the durable flag for a message. | |
duration | ttl () const |
Get the TTL for a message. More... | |
void | ttl (duration) |
Set the TTL for a message. | |
uint8_t | priority () const |
Get the priority for a message. More... | |
void | priority (uint8_t) |
Set the priority for a message. | |
bool | first_acquirer () const |
Get the first acquirer flag for a message. More... | |
void | first_acquirer (bool) |
Set the first acquirer flag for a message. | |
uint32_t | delivery_count () const |
Get the delivery count for a message. More... | |
void | delivery_count (uint32_t) |
Get the delivery count for a message. | |
Message groups | |
void | group_id (const std::string &s) |
std::string | group_id () const |
void | reply_to_group_id (const std::string &s) |
std::string | reply_to_group_id () const |
int32_t | group_sequence () const |
Get the group sequence for a message. More... | |
void | group_sequence (int32_t) |
Set the group sequence for a message. | |
Extended attributes | |
property_map & | application_properties () |
Application properties map, can be modified in place. | |
const property_map & | application_properties () const |
annotation_map & | message_annotations () |
Message annotations map, can be modified in place. | |
const annotation_map & | message_annotations () const |
annotation_map & | delivery_annotations () |
Delivery annotations map, can be modified in place. | |
const annotation_map & | delivery_annotations () const |
An AMQP message.
Value semantics: can be copied or assigned to make a new message.
|
inline |
Create a message with its body set from any value that can be assigned to a proton::value.
uint32_t delivery_count | ( | ) | const |
Get the delivery count for a message.
The delivery count field tracks how many attempts have been made to delivery a message.
bool durable | ( | ) | const |
Get the durable flag for a message.
The durable flag indicates that any parties taking responsibility for the message must durably store the content.
void encode | ( | std::vector< char > & | bytes | ) | const |
Encode entire message into a byte vector, growing it if necessary.
bool first_acquirer | ( | ) | const |
Get the first acquirer flag for a message.
When set to true, the first acquirer flag for a message indicates that the recipient of the message is the first recipient to acquire the message, i.e. there have been no failed delivery attempts to other acquirers. Note that this does not mean the message has not been delivered to, but not acquired, by other recipients.
int32_t group_sequence | ( | ) | const |
Get the group sequence for a message.
The group sequence of a message identifies the relative ordering of messages within a group. The default value for the group sequence of a message is zero.
bool inferred | ( | ) | const |
Get the inferred flag for a message.
The inferred flag for a message indicates how the message content is encoded into AMQP sections. If inferred is true then binary and list values in the body of the message will be encoded as AMQP DATA and AMQP SEQUENCE sections, respectively. If inferred is false, then all values in the body of the message will be encoded as AMQP VALUE sections regardless of their type.
uint8_t priority | ( | ) | const |
Get the priority for a message.
The priority of a message impacts ordering guarantees. Within a given ordered context, higher priority messages may jump ahead of lower priority messages.
duration ttl | ( | ) | const |
Get the TTL for a message.
The TTL (time to live) for a message determines how long a message is considered live. When a message is held for retransmit, the TTL is decremented. Once the TTL reaches zero, the message is considered dead. Once a message is considered dead it may be dropped.