Qpid Proton C++ API  0.17.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
message Class Reference

An AMQP message. More...

#include <message.hpp>

Classes

class  annotation_map
 Experimental - A map of AMQP annotation keys and AMQP values. More...
 
class  property_map
 Experimental - A map of string keys and AMQP scalar values. More...
 

Public Member Functions

 message ()
 Create an empty message.
 
 message (const message &)
 Copy a message.
 
messageoperator= (const message &)
 Copy a message.
 
 message (message &&)
 Move a message.
 
messageoperator= (message &&)
 Move a message.
 
 message (const value &x)
 Create a message with its body set from any value that can be converted to a proton::value. More...
 
Basic properties and methods
void clear ()
 Clear the message content and properties.
 
void id (const message_id &id)
 Set the message ID. More...
 
message_id id () const
 Get the message ID.
 
void user (const std::string &user)
 Set the user name or ID.
 
std::string user () const
 Get the user name or ID.
 
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 to (const std::string &addr)
 Set the destination address.
 
std::string to () const
 Get the destination address.
 
void reply_to (const std::string &addr)
 Set the address for replies.
 
std::string reply_to () const
 Get the address for replies.
 
void correlation_id (const message_id &)
 Set the ID for matching related messages.
 
message_id correlation_id () const
 Get the ID for matching related messages.
 
Content
void body (const value &x)
 Set the body. Equivalent to body() = x.
 
const valuebody () const
 Get the body.
 
valuebody ()
 Get a reference to the body that can be modified in place.
 
void subject (const std::string &s)
 Set the subject.
 
std::string subject () const
 Get the subject.
 
void content_type (const std::string &s)
 Set the content type of the body.
 
std::string content_type () const
 Get the content type of the body.
 
void content_encoding (const std::string &s)
 Set the content encoding of the body.
 
std::string content_encoding () const
 Get the content encoding of the body.
 
void expiry_time (timestamp t)
 Set the expiration time.
 
timestamp expiry_time () const
 Get the expiration time.
 
void creation_time (timestamp t)
 Set the creation time.
 
timestamp creation_time () const
 Get the creation time.
 
bool inferred () const
 Get the inferred flag. More...
 
void inferred (bool)
 Set the inferred flag.
 
Transfer headers
bool durable () const
 Get the durable flag. More...
 
void durable (bool)
 Set the durable flag.
 
duration ttl () const
 Get the TTL. More...
 
void ttl (duration)
 Set the TTL.
 
uint8_t priority () const
 Get the priority. More...
 
void priority (uint8_t)
 Set the priority.
 
bool first_acquirer () const
 Get the first acquirer flag. More...
 
void first_acquirer (bool)
 Set the first acquirer flag.
 
uint32_t delivery_count () const
 Get the delivery count. More...
 
void delivery_count (uint32_t)
 Get the delivery count.
 
Message groups
void group_id (const std::string &s)
 Set the message group ID.
 
std::string group_id () const
 Get the message group ID.
 
void reply_to_group_id (const std::string &s)
 Set the reply-to group ID.
 
std::string reply_to_group_id () const
 Get the reply-to group ID.
 
int32_t group_sequence () const
 Get the group sequence. More...
 
void group_sequence (int32_t)
 Set the group sequence for a message.
 
Extended attributes
property_mapproperties ()
 Experimental - Get the application properties map. More...
 
const property_mapproperties () const
 Experimental - Get the application properties map. More...
 
annotation_mapmessage_annotations ()
 Experimental - Get the message annotations map. More...
 
const annotation_mapmessage_annotations () const
 Experimental - Get the message annotations map. More...
 
annotation_mapdelivery_annotations ()
 Experimental - Get the delivery annotations map. More...
 
const annotation_mapdelivery_annotations () const
 Experimental - Get the delivery annotations map. More...
 

Static Public Attributes

static const uint8_t default_priority
 Default priority assigned to new messages.
 

Detailed Description

Constructor & Destructor Documentation

message ( const value x)

Create a message with its body set from any value that can be converted to a proton::value.

Member Function Documentation

annotation_map& delivery_annotations ( )

Experimental - Get the delivery annotations map.

It can be modified in place.

const annotation_map& delivery_annotations ( ) const

Experimental - Get the delivery annotations map.

It can be modified in place.

uint32_t delivery_count ( ) const

Get the delivery count.

The delivery count field tracks how many attempts have been made to deliver a message.

bool durable ( ) const

Get the durable flag.

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.

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.

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.

void id ( const message_id id)

Set the message ID.

The message ID uniquely identifies a message within a messaging system.

Examples:
direct_recv.cpp, direct_send.cpp, simple_recv.cpp, and simple_send.cpp.
bool inferred ( ) const

Get the inferred flag.

The inferred flag for a message indicates how the message content is encoded into AMQP sections. If the 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.

annotation_map& message_annotations ( )

Experimental - Get the message annotations map.

It can be modified in place.

const annotation_map& message_annotations ( ) const

Experimental - Get the message annotations map.

It can be modified in place.

uint8_t priority ( ) const

Get the priority.

The priority of a message impacts ordering guarantees. Within a given ordered context, higher priority messages may jump ahead of lower priority messages.

The default value set on newly constructed messages is message::default_priority.

property_map& properties ( )

Experimental - Get the application properties map.

It can be modified in place.

const property_map& properties ( ) const

Experimental - Get the application properties map.

It can be modified in place.

duration ttl ( ) const

Get the TTL.

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.


The documentation for this class was generated from the following file: