Interface IMessageBuilder<T>
A typed MessageBuilder.
Inherited Members
Namespace: Steeltoe.Integration.Support
Assembly: Steeltoe.Integration.Abstractions.dll
Syntax
public interface IMessageBuilder<T> : IMessageBuilder
Type Parameters
Name | Description |
---|---|
T | the type of the payload |
Properties
| Edit this page View SourcePayload
Gets the payload of the message
Declaration
T Payload { get; }
Property Value
Type | Description |
---|---|
T |
Methods
| Edit this page View SourceBuild()
Build the message
Declaration
IMessage<T> Build()
Returns
Type | Description |
---|---|
IMessage<T> | the message |
CopyHeaders(IDictionary<String, Object>)
Adds the headers to the message overwriting any existing values.
Declaration
IMessageBuilder<T> CopyHeaders(IDictionary<string, object> headersToCopy)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | headersToCopy | the headers to add |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
CopyHeadersIfAbsent(IDictionary<String, Object>)
Adds the headers to the message but will not overwrite any existing values.
Declaration
IMessageBuilder<T> CopyHeadersIfAbsent(IDictionary<string, object> headersToCopy)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | headersToCopy | the headers to add |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
FilterAndCopyHeadersIfAbsent(IDictionary<String, Object>, String[])
Remove headers from the provided map matching to the provided pattens and only after that copy the result into the target message headers.
Declaration
IMessageBuilder<T> FilterAndCopyHeadersIfAbsent(IDictionary<string, object> headersToCopy, params string[] headerPatternsToFilter)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | headersToCopy | the set of headers to copy |
System.String[] | headerPatternsToFilter | header patterns to filter before copy |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
PopSequenceDetails()
Removes a sequence details header from the message
Declaration
IMessageBuilder<T> PopSequenceDetails()
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
PushSequenceDetails(Object, Int32, Int32)
Adds a sequence details header to the message
Declaration
IMessageBuilder<T> PushSequenceDetails(object correlationId, int sequenceNumber, int sequenceSize)
Parameters
Type | Name | Description |
---|---|---|
System.Object | correlationId | correlation id to use in sequence |
System.Int32 | sequenceNumber | the sequence number |
System.Int32 | sequenceSize | the size of the sequence number |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
RemoveHeader(String)
Remove the header if present
Declaration
IMessageBuilder<T> RemoveHeader(string headerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the name of the header to remove |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
RemoveHeaders(String[])
Remove the headers matched by the header patterns from the message
Declaration
IMessageBuilder<T> RemoveHeaders(params string[] headerPatterns)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | headerPatterns | header patterns to match |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetCorrelationId(Object)
Adds the correlationId to the headers
Declaration
IMessageBuilder<T> SetCorrelationId(object correlationId)
Parameters
Type | Name | Description |
---|---|---|
System.Object | correlationId | the id to add |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetErrorChannel(IMessageChannel)
Adds an error channel to the messsage
Declaration
IMessageBuilder<T> SetErrorChannel(IMessageChannel errorChannel)
Parameters
Type | Name | Description |
---|---|---|
IMessageChannel | errorChannel | the error channel |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetErrorChannelName(String)
Adds an error channel name to the message
Declaration
IMessageBuilder<T> SetErrorChannelName(string errorChannelName)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorChannelName | the name of the error channel |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetExpirationDate(Int64)
Adds an expiration date in the headers
Declaration
IMessageBuilder<T> SetExpirationDate(long expirationDate)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | expirationDate | expiration date added to header |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetExpirationDate(Nullable<DateTime>)
Adds an expiration date in the headers
Declaration
IMessageBuilder<T> SetExpirationDate(DateTime? expirationDate)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<DateTime> | expirationDate | expiration date added to header |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetHeader(String, Object)
Add a header and value to the message
Declaration
IMessageBuilder<T> SetHeader(string headerName, object headerValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | name of the header |
System.Object | headerValue | value of the header item |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetHeaderIfAbsent(String, Object)
Add a header and value to the message if not present
Declaration
IMessageBuilder<T> SetHeaderIfAbsent(string headerName, object headerValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | name of the header |
System.Object | headerValue | value of the header item |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetPriority(Int32)
Adds a priority header to the message
Declaration
IMessageBuilder<T> SetPriority(int priority)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | priority | the priority to add |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetReplyChannel(IMessageChannel)
Adds a reply channel to the message
Declaration
IMessageBuilder<T> SetReplyChannel(IMessageChannel replyChannel)
Parameters
Type | Name | Description |
---|---|---|
IMessageChannel | replyChannel | the reply channel |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetReplyChannelName(String)
Adds a reply channel name to the message
Declaration
IMessageBuilder<T> SetReplyChannelName(string replyChannelName)
Parameters
Type | Name | Description |
---|---|---|
System.String | replyChannelName | the reply channel name |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetSequenceNumber(Int32)
Adds sequence details header to the message
Declaration
IMessageBuilder<T> SetSequenceNumber(int sequenceNumber)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sequenceNumber | the sequence number |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |
SetSequenceSize(Int32)
Sets the size of the sequence number
Declaration
IMessageBuilder<T> SetSequenceSize(int sequenceSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sequenceSize | the size |
Returns
Type | Description |
---|---|
IMessageBuilder<T> | the builder |