azure-core-amqp
Loading...
Searching...
No Matches
amqp_properties.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#pragma once
5
6#include "amqp_value.hpp"
7
8#include <azure/core/nullable.hpp>
9
10#include <chrono>
11#include <vector>
12
13namespace Azure { namespace Core { namespace Amqp { namespace Models {
14
23 struct MessageProperties final
24 {
29 MessageProperties() = default;
30
35 ~MessageProperties() = default;
36
39
42
44 MessageProperties(MessageProperties const& other) = default;
45
48
58 Nullable<AmqpValue> MessageId;
59
65 Nullable<std::vector<uint8_t>> UserId;
66
72 Nullable<AmqpValue> To;
73
78 Nullable<std::string> Subject;
79
83 Nullable<AmqpValue> CorrelationId;
84
87 Nullable<AmqpValue> ReplyTo;
88
106 Nullable<std::string> ContentType;
107
108 // cspell: ignore IANAHTTPPARAMS
134 Nullable<std::string> ContentEncoding;
135
140 Nullable<std::chrono::system_clock::time_point> AbsoluteExpiryTime;
141
143 Nullable<std::chrono::system_clock::time_point> CreationTime;
144
149 Nullable<std::string> GroupId;
150
155 Nullable<uint32_t> GroupSequence;
156
162 Nullable<std::string> ReplyToGroupId;
163
168 bool operator==(MessageProperties const& that) const noexcept;
169
174 bool ShouldSerialize() const noexcept;
175
181 static std::vector<uint8_t> Serialize(MessageProperties const& properties);
182
189 static MessageProperties Deserialize(uint8_t const* data, size_t size);
190 };
191
198 std::ostream& operator<<(std::ostream& stream, MessageProperties const& properties);
199}}}} // namespace Azure::Core::Amqp::Models
Represents the immutable properties of an AMQP message.
Definition amqp_properties.hpp:24
MessageProperties & operator=(MessageProperties const &other)=default
Copy Assignment operator.
static MessageProperties Deserialize(uint8_t const *data, size_t size)
Deserialize a MessageProperties object from a vector of bytes.
Definition amqp_properties.cpp:298
MessageProperties(MessageProperties const &other)=default
Copy Constructor.
Nullable< std::vector< uint8_t > > UserId
User ID.
Definition amqp_properties.hpp:65
Nullable< std::string > Subject
The subject of the message.
Definition amqp_properties.hpp:78
Nullable< AmqpValue > To
The to field identifies the node that is the intended destination of the message.
Definition amqp_properties.hpp:72
Nullable< std::string > ContentType
The content-type field describes the payload type.
Definition amqp_properties.hpp:106
MessageProperties(MessageProperties &&other)=default
Move Constructor.
bool ShouldSerialize() const noexcept
Should this MessageProperties object be serialized.
Definition amqp_properties.cpp:280
Nullable< std::chrono::system_clock::time_point > AbsoluteExpiryTime
The absolute expiry time of the message.
Definition amqp_properties.hpp:140
Nullable< std::string > ContentEncoding
MIME Content Encoding.
Definition amqp_properties.hpp:134
bool operator==(MessageProperties const &that) const noexcept
Compare two message properties objects.
Definition amqp_properties.cpp:264
Nullable< std::string > GroupId
The group this message belongs to.
Definition amqp_properties.hpp:149
Nullable< std::string > ReplyToGroupId
The group the reply message belongs to.
Definition amqp_properties.hpp:162
Nullable< AmqpValue > ReplyTo
The address of the node to send replies to.
Definition amqp_properties.hpp:87
Nullable< AmqpValue > CorrelationId
This is a client-specific id that can be used to mark or identify messages between clients.
Definition amqp_properties.hpp:83
Nullable< AmqpValue > MessageId
The message-id, if set, uniquely identifies a message within the message system. The message producer...
Definition amqp_properties.hpp:58
static std::vector< uint8_t > Serialize(MessageProperties const &properties)
Serialize a MessageProperties object into a vector of bytes.
Definition amqp_properties.cpp:289
Nullable< uint32_t > GroupSequence
The sequence-number of this message within its group .
Definition amqp_properties.hpp:155
MessageProperties()=default
Default constructor.
Nullable< std::chrono::system_clock::time_point > CreationTime
the time when this message was created.
Definition amqp_properties.hpp:143
MessageProperties & operator=(MessageProperties &&other)=default
Move Assignment operator.