azure-core-amqp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Azure::Core::Amqp::Models::AmqpMessage Class Referencefinal

An AmqpMessage object represents a received AMQP message. More...

#include <amqp_message.hpp>

Public Member Functions

 AmqpMessage ()=default
 Construct a new AMQP Message object.
 
 ~AmqpMessage ()=default
 Destroy an instance of an AMQP Message object.
 
 AmqpMessage (AmqpMessage &&)=default
 Create a new AMQP Message from an existing message moving the contents.
 
 AmqpMessage (AmqpMessage const &)=default
 Construct a new AMQP message object from an existing object.
 
AmqpMessageoperator= (AmqpMessage const &)=default
 Copy an AMQP message object to another object.
 
AmqpMessageoperator= (AmqpMessage &&)=default
 Move an AMQP message object to another object.
 
bool operator== (AmqpMessage const &that) const noexcept
 Compare two AmqpMessages for equality.
 
bool operator!= (AmqpMessage const &that) const noexcept
 Compare two AmqpMessage values.
 
 AmqpMessage (std::nullptr_t)
 Construct an empty AMQP Message.
 
 operator bool () const noexcept
 Returns True if the AMQP message has a value, false otherwise.
 
void SetBody (std::vector< AmqpList > const &bodySequence)
 Sets the body of the message to a list of sequence sections.
 
void SetBody (AmqpList const &bodySequence)
 Appends a list to the body of the message.
 
void SetBody (std::vector< AmqpBinaryData > const &bodyBinarySequence)
 Set the body of the message.
 
void SetBody (AmqpBinaryData const &bodyBinary)
 Appends a binary value to the body of the message.
 
void SetBody (AmqpValue const &bodyValue)
 Set the body of the message.
 
std::vector< AmqpList > const & GetBodyAsAmqpList () const
 Returns a list of Amqp Sequence values.
 
AmqpValue const & GetBodyAsAmqpValue () const
 Returns an Amqp Value message body.
 
std::vector< AmqpBinaryData > const & GetBodyAsBinary () const
 Returns an Amqp Binary message body.
 

Static Public Member Functions

static std::vector< uint8_t > Serialize (AmqpMessage const &message)
 Serialize the message into a buffer.
 
static AmqpMessage Deserialize (std::uint8_t const *buffer, size_t size)
 Deserialize the message from a buffer.
 

Public Attributes

uint32_t MessageFormat = AmqpDefaultMessageFormatValue
 The message format.
 
MessageHeader Header
 The header for the message.
 
AmqpMap DeliveryAnnotations
 Delivery Annotations for the message.
 
AmqpMap MessageAnnotations
 Message Annotations for the message.
 
MessageProperties Properties
 Immutable Properties for the message.
 
std::map< std::string, AmqpValueApplicationProperties
 Application Properties for the message.
 
AmqpValue DeliveryTag
 Delivery Tag for the message.
 
AmqpMap Footer
 Footer for the message.
 
MessageBodyType BodyType {MessageBodyType::None}
 

Detailed Description

Remarks
An AMQP message is comprised of a header, properties, application properties, and body. The body of the message can be one of the following types:
  • A single AMQP Value.
  • One or more binary data sections.
  • One or more sequence sections.

For more information, see AMQP Message Format.

Member Function Documentation

◆ Deserialize()

AmqpMessage Azure::Core::Amqp::Models::AmqpMessage::Deserialize ( std::uint8_t const *  buffer,
size_t  size 
)
static
Remarks
This API will fail if BodyType is not set.

◆ GetBodyAsAmqpList()

std::vector< AmqpList > const & Azure::Core::Amqp::Models::AmqpMessage::GetBodyAsAmqpList ( ) const
Remarks
This API will fail if BodyType is not MessageBodyType::Sequence.

◆ GetBodyAsAmqpValue()

AmqpValue const & Azure::Core::Amqp::Models::AmqpMessage::GetBodyAsAmqpValue ( ) const
Remarks
This API will fail if BodyType is not MessageBodyType::Value.

◆ GetBodyAsBinary()

std::vector< AmqpBinaryData > const & Azure::Core::Amqp::Models::AmqpMessage::GetBodyAsBinary ( ) const
Remarks
This API will fail if BodyType is not MessageBodyType::Binary.

◆ operator bool()

Azure::Core::Amqp::Models::AmqpMessage::operator bool ( ) const
inlinenoexcept
Returns
true if the AMQP message has a value, false otherwise.

◆ operator=() [1/2]

AmqpMessage & Azure::Core::Amqp::Models::AmqpMessage::operator= ( AmqpMessage &&  )
default
Returns
A reference to this.

◆ operator=() [2/2]

AmqpMessage & Azure::Core::Amqp::Models::AmqpMessage::operator= ( AmqpMessage const &  )
default
Returns
A reference to this.

◆ Serialize()

std::vector< uint8_t > Azure::Core::Amqp::Models::AmqpMessage::Serialize ( AmqpMessage const &  message)
static
Remarks
This API will fail if BodyType is not set.

◆ SetBody() [1/5]

void Azure::Core::Amqp::Models::AmqpMessage::SetBody ( AmqpBinaryData const &  bodyBinary)

An AMQP Message Body can be one of the following formats:

  • One or more binary data sections
  • One or more sequence sections.
  • A single AMQP Value.

This method sets the body of the message to a sequence data values. See Amqp Data for more information.

Parameters
bodyBinary- a single value binary data.
Remarks
This is a convenience method to make it simpler to append a single binary value to the message body.

◆ SetBody() [2/5]

void Azure::Core::Amqp::Models::AmqpMessage::SetBody ( AmqpList const &  bodySequence)

An AMQP Message Body can be one of the following formats:

  • One or more binary data sections
  • One or more sequence sections.
  • A single AMQP Value.

This method appends the bodySequence value to the sequence of sections. See Amqp Sequence for more information.

Parameters
bodySequence- the list of AMQP values which make up the body of the message.
Remarks
This is a convenience method to make it simpler to append a single binary value to the message body.

◆ SetBody() [3/5]

void Azure::Core::Amqp::Models::AmqpMessage::SetBody ( AmqpValue const &  bodyValue)

An AMQP Message Body can be one of the following formats:

  • One or more binary data sections
  • One or more sequence sections.
  • A single AMQP Value.

This method sets the body of the message to a single AMQP value. See Amqp Value for more information.

Parameters
bodyValue- a single value binary data.

◆ SetBody() [4/5]

void Azure::Core::Amqp::Models::AmqpMessage::SetBody ( std::vector< AmqpBinaryData > const &  bodyBinarySequence)

An AMQP Message Body can be one of the following formats:

  • One or more binary data sections
  • One or more sequence sections.
  • A single AMQP Value.

This method sets the body of the message to a sequence data values. See Amqp Data for more information.

Parameters
bodyBinarySequence- a sequence of binary data which which makes up the body of the message.

◆ SetBody() [5/5]

void Azure::Core::Amqp::Models::AmqpMessage::SetBody ( std::vector< AmqpList > const &  bodySequence)

An AMQP Message Body can be one of the following formats:

  • One or more binary data sections
  • One or more sequence sections.
  • A single AMQP Value.

This method appends the bodySequence value to the sequence of sections. See Amqp Sequence for more information.

Parameters
bodySequence- the list of AMQP values which make up the body of the message.

Member Data Documentation

◆ ApplicationProperties

std::map<std::string, AmqpValue> Azure::Core::Amqp::Models::AmqpMessage::ApplicationProperties

For more information, see AMQP Application Properties.

◆ BodyType

MessageBodyType Azure::Core::Amqp::Models::AmqpMessage::BodyType {MessageBodyType::None}

Specifies the type of the body.

An AMQP Message Body can be one of the following formats:

  • One or more binary data sections
  • One or more sequence sections.
  • A single AMQP Value.

◆ DeliveryAnnotations

AmqpMap Azure::Core::Amqp::Models::AmqpMessage::DeliveryAnnotations

For more information, see AMQP Delivery Annotations.

◆ DeliveryTag

AmqpValue Azure::Core::Amqp::Models::AmqpMessage::DeliveryTag

For more information, see AMQP Transport Transfer.

◆ Footer

AmqpMap Azure::Core::Amqp::Models::AmqpMessage::Footer

For more information, see AMQP Footer.

◆ Header

MessageHeader Azure::Core::Amqp::Models::AmqpMessage::Header

For more information, see AMQP Message Header

◆ MessageAnnotations

AmqpMap Azure::Core::Amqp::Models::AmqpMessage::MessageAnnotations

For more information, see AMQP Message Annotations.

◆ MessageFormat

uint32_t Azure::Core::Amqp::Models::AmqpMessage::MessageFormat = AmqpDefaultMessageFormatValue

By default, AMQP uses 0, however services can override this to express additional semantics about the message payload.

For more information, see AMQP Message Format.

◆ Properties

MessageProperties Azure::Core::Amqp::Models::AmqpMessage::Properties

For more information, see AMQP Properties.


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