Class Message
The Message class represents an AMQP message.
Inheritance
Implements
Inherited Members
Namespace: Amqp
Assembly: Amqp.Net.dll
Syntax
public class Message : IDisposable
Constructors
Message()
Initializes an empty message.
Declaration
public Message()
Message(Object)
Initializes a message from an object as the body. The object is wrapped in an AmqpValue section. To control the body section type, create an empty message and set BodySection to either AmqpValue, Data or AmqpSequence.
Declaration
public Message(object body)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | body | the object stored in the AmqpValue section. |
Fields
ApplicationProperties
The application properties section.
Declaration
public ApplicationProperties ApplicationProperties
Field Value
| Type | Description |
|---|---|
| ApplicationProperties |
BodySection
The body section. The library supports one section only.
Declaration
public RestrictedDescribed BodySection
Field Value
| Type | Description |
|---|---|
| RestrictedDescribed |
DeliveryAnnotations
The delivery annotation section.
Declaration
public DeliveryAnnotations DeliveryAnnotations
Field Value
| Type | Description |
|---|---|
| DeliveryAnnotations |
Footer
The footer section.
Declaration
public Footer Footer
Field Value
| Type | Description |
|---|---|
| Footer |
Header
The header section.
Declaration
public Header Header
Field Value
| Type | Description |
|---|---|
| Header |
MessageAnnotations
The message annotation section.
Declaration
public MessageAnnotations MessageAnnotations
Field Value
| Type | Description |
|---|---|
| MessageAnnotations |
Properties
The properties section.
Declaration
public Properties Properties
Field Value
| Type | Description |
|---|---|
| Properties |
Properties
Body
Gets the object from the body. The returned value depends on the type of the body section. Use the BodySection field if the entire section is needed.
Declaration
public object Body { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
DeliveryTag
Gets the delivery tag associated with the message.
Declaration
public byte[] DeliveryTag { get; }
Property Value
| Type | Description |
|---|---|
| System.Byte[] |
Methods
Decode(ByteBuffer)
Decodes a message from a buffer and advance the buffer read cursor.
Declaration
public static Message Decode(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer. |
Returns
| Type | Description |
|---|---|
| Message |
Dispose()
Disposes the current message to release resources.
Declaration
public void Dispose()
Encode()
Encodes the message into a buffer.
Declaration
public ByteBuffer Encode()
Returns
| Type | Description |
|---|---|
| ByteBuffer | The buffer. |