Class EnvelopeFactory
Can be used to instantiate an IOutboundEnvelope or an IInboundEnvelope.
Inherited Members
Namespace: Silverback.Messaging.Messages
Assembly: Silverback.Integration.dll
Syntax
public static class EnvelopeFactory
Methods
| Improve this doc View sourceCreate(byte[]?, MessageHeaderCollection?, IConsumerEndpoint, IBrokerMessageIdentifier)
Creates an IRawInboundEnvelope.
Declaration
public static IRawInboundEnvelope Create(byte[]? rawMessage, MessageHeaderCollection? headers, IConsumerEndpoint endpoint, IBrokerMessageIdentifier identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | rawMessage | The raw message body. |
| MessageHeaderCollection | headers | The message headers. |
| IConsumerEndpoint | endpoint | The source endpoint. |
| IBrokerMessageIdentifier | identifier |
Returns
| Type | Description |
|---|---|
| IRawInboundEnvelope | An IInboundEnvelope<TMessage> containing the specified message. |
Create(Stream, MessageHeaderCollection?, IConsumerEndpoint, IBrokerMessageIdentifier)
Creates an IRawInboundEnvelope.
Declaration
public static IRawInboundEnvelope Create(Stream rawMessageStream, MessageHeaderCollection? headers, IConsumerEndpoint endpoint, IBrokerMessageIdentifier identifier)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | rawMessageStream | The raw message body. |
| MessageHeaderCollection | headers | The message headers. |
| IConsumerEndpoint | endpoint | The source endpoint. |
| IBrokerMessageIdentifier | identifier |
Returns
| Type | Description |
|---|---|
| IRawInboundEnvelope | An IInboundEnvelope<TMessage> containing the specified message. |
Create<TMessage>(TMessage, IRawInboundEnvelope)
Creates an IInboundEnvelope<TMessage> copying another envelope and replacing just the deserialized message.
Declaration
public static IInboundEnvelope<TMessage> Create<TMessage>(TMessage message, IRawInboundEnvelope rawInboundEnvelope) where TMessage : class
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to be wrapped in the envelope. |
| IRawInboundEnvelope | rawInboundEnvelope | The envelope to be copied. |
Returns
| Type | Description |
|---|---|
| IInboundEnvelope<TMessage> | An IInboundEnvelope<TMessage> containing the specified message. |
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the message being wrapped. |
Create<TMessage>(TMessage, MessageHeaderCollection?, IProducerEndpoint)
Creates an IOutboundEnvelope<TMessage>.
Declaration
public static IOutboundEnvelope<TMessage> Create<TMessage>(TMessage message, MessageHeaderCollection? headers, IProducerEndpoint endpoint) where TMessage : class
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to be wrapped in the envelope. |
| MessageHeaderCollection | headers | The message headers. |
| IProducerEndpoint | endpoint | The destination endpoint. |
Returns
| Type | Description |
|---|---|
| IOutboundEnvelope<TMessage> | An IOutboundEnvelope<TMessage> containing the specified message. |
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the message being wrapped. |