Class ProducerOptions
Options used to configure a message producer.
Implements
Inherited Members
Namespace: CodersRealm.NmsAmqpClient
Assembly: CodersRealm.NmsAmqpClient.dll
Syntax
public record ProducerOptions : IEquatable<ProducerOptions>
Remarks
Note that acknowledgement modes other than Apache.NMS.AcknowledgementMode.Transactional are treated as Apache.NMS.AcknowledgementMode.AutoAcknowledge.
Constructors
ProducerOptions(IDestination?, string?, DestinationType?, AcknowledgementMode, bool, bool, TimeSpan, MsgDeliveryMode, TimeSpan, MsgPriority, ProducerTransformerAsync?)
Options used to configure a message producer.
Declaration
public ProducerOptions(IDestination? Destination = null, string? DestinationName = null, DestinationType? DestinationType = null, AcknowledgementMode AcknowledgementMode = AcknowledgementMode.AutoAcknowledge, bool DisableMessageID = false, bool DisableMessageTimestamp = false, TimeSpan RequestTimeout = default, MsgDeliveryMode MsgDeliveryMode = MsgDeliveryMode.Persistent, TimeSpan MsgTimeToLive = default, MsgPriority MsgPriority = MsgPriority.Normal, ProducerTransformerAsync? ProducerTransformer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IDestination | Destination | The destination instance to which messages will be sent. If |
| string | DestinationName | The name of the destination (queue or topic) to which messages will be sent. This is used when a destination instance is not provided via Destination. |
| DestinationType? | DestinationType | The type of the destination (for example, Queue or Topic). When set together with DestinationName, it indicates how the named destination should be interpreted. |
| AcknowledgementMode | AcknowledgementMode | The acknowledgement mode used by the producer. Defaults to Apache.NMS.AcknowledgementMode.AutoAcknowledge. |
| bool | DisableMessageID | When true, the message ID will not be written to outgoing messages. Defaults to |
| bool | DisableMessageTimestamp | When true, the message timestamp will not be written to outgoing messages. Defaults to |
| TimeSpan | RequestTimeout | The request timeout to use for producer operations. A value of Zero indicates no timeout. |
| MsgDeliveryMode | MsgDeliveryMode | The delivery mode for produced messages (for example, persistent or non-persistent). Defaults to Apache.NMS.MsgDeliveryMode.Persistent. |
| TimeSpan | MsgTimeToLive | The time-to-live for produced messages. A value of Zero indicates the message does not expire. |
| MsgPriority | MsgPriority | The priority assigned to produced messages. Defaults to Apache.NMS.MsgPriority.Normal. |
| ProducerTransformerAsync | ProducerTransformer | Optional transformer delegate that can be used to modify or enrich a message before it is sent by the producer. |
Remarks
Note that acknowledgement modes other than Apache.NMS.AcknowledgementMode.Transactional are treated as Apache.NMS.AcknowledgementMode.AutoAcknowledge.
Properties
AcknowledgementMode
The acknowledgement mode used by the producer. Defaults to Apache.NMS.AcknowledgementMode.AutoAcknowledge.
Declaration
public AcknowledgementMode AcknowledgementMode { get; init; }
Property Value
| Type | Description |
|---|---|
| AcknowledgementMode |
Destination
The destination instance to which messages will be sent. If null, the DestinationName and
DestinationType may be used to resolve the destination at runtime.
Declaration
public IDestination? Destination { get; init; }
Property Value
| Type | Description |
|---|---|
| IDestination |
DestinationName
The name of the destination (queue or topic) to which messages will be sent. This is used when a destination instance is not provided via Destination.
Declaration
public string? DestinationName { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
DestinationType
The type of the destination (for example, Queue or Topic). When set together with DestinationName, it indicates how the named destination should be interpreted.
Declaration
public DestinationType? DestinationType { get; init; }
Property Value
| Type | Description |
|---|---|
| DestinationType? |
DisableMessageID
When true, the message ID will not be written to outgoing messages. Defaults to false.
Declaration
public bool DisableMessageID { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
DisableMessageTimestamp
When true, the message timestamp will not be written to outgoing messages. Defaults to true.
Declaration
public bool DisableMessageTimestamp { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
MsgDeliveryMode
The delivery mode for produced messages (for example, persistent or non-persistent). Defaults to Apache.NMS.MsgDeliveryMode.Persistent.
Declaration
public MsgDeliveryMode MsgDeliveryMode { get; init; }
Property Value
| Type | Description |
|---|---|
| MsgDeliveryMode |
MsgPriority
The priority assigned to produced messages. Defaults to Apache.NMS.MsgPriority.Normal.
Declaration
public MsgPriority MsgPriority { get; init; }
Property Value
| Type | Description |
|---|---|
| MsgPriority |
MsgTimeToLive
The time-to-live for produced messages. A value of Zero indicates the message does not expire.
Declaration
public TimeSpan MsgTimeToLive { get; init; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
ProducerTransformer
Optional transformer delegate that can be used to modify or enrich a message before it is sent by the producer.
Declaration
public ProducerTransformerAsync? ProducerTransformer { get; init; }
Property Value
| Type | Description |
|---|---|
| ProducerTransformerAsync |
RequestTimeout
The request timeout to use for producer operations. A value of Zero indicates no timeout.
Declaration
public TimeSpan RequestTimeout { get; init; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |