TransportMessageBuilder
Properties
Headers
public List<TransportHeader> Headers { get; }Contains the list of name/value pair transport headers.
HasRecipient
public bool HasRecipient { get; }Returns true if the transport message has a RecipientInboxWorkTransportUri; else false.
ShouldReply
public bool ShouldReply { get; }ShouldSendToSelf
public bool ShouldSendToSelf { get; }InboxName
public string? InboxName { get; }The name of the additional inbox of this endpoint that the message should be sent to, if any.
Methods
ToSelf
public TransportMessageBuilder ToSelf();This sets the ShouldSendToSelf flag. During dispatch the RecipientInboxWorkTransportUri will be set to the primary inbox work transport uri.
ToInbox
public TransportMessageBuilder ToInbox(string name);This sets the InboxName. During dispatch the RecipientInboxWorkTransportUri will be set to the work transport uri of the additional inbox with the given name. An InvalidOperationException is thrown if no additional inbox with that name has been configured.
ToSelf, ToInbox, AsReply and WithRecipient are mutually exclusive.
AsReply
public TransportMessageBuilder AsReply();This sets the ShouldReply flag. During dispatch the RecipientInboxWorkTransportUri will be set to the SenderInboxWorkTransportUri of the transport message that was received.
WithRecipient
public TransportMessageBuilder WithRecipient(ITransport transport);
public TransportMessageBuilder WithRecipient(Uri uri);
public TransportMessageBuilder WithRecipient(string uri);This sets the RecipientInboxWorkTransportUri explicitly and no routing will be applied.
WithSender
public TransportMessageBuilder WithSender(ITransport transport);
public TransportMessageBuilder WithSender(Uri uri);
public TransportMessageBuilder WithSender(string uri);This sets the SenderInboxWorkTransportUri explicitly.
WithCorrelationId
public TransportMessageBuilder WithCorrelationId(string correlationId);Sets the correlation id for the message.
DeferUntil
public TransportMessageBuilder DeferUntil(DateTimeOffset ignoreUntil);Ignores the TransportMessage until the given date/time has been reached.
DeferFor
public TransportMessageBuilder DeferFor(TimeSpan delay);Ignores the TransportMessage for the given duration.
ExpiresAt
public TransportMessageBuilder ExpiresAt(DateTimeOffset expiresAt);The message will only remain valid until this date is reached.
ExpiresIn
public TransportMessageBuilder ExpiresIn(TimeSpan after);The message will only remain valid for the given duration.
WithPriority
public TransportMessageBuilder WithPriority(int priority);