Interface IMessageBuilder
A message builder that creates immutable GenericMessages.
Namespace: Steeltoe.Integration.Support
Assembly: Steeltoe.Integration.Abstractions.dll
Syntax
public interface IMessageBuilder
Properties
| Edit this page View SourceHeaders
Gets the current headers of the message
Declaration
IDictionary<string, object> Headers { get; }
Property Value
Type | Description |
---|---|
IDictionary<System.String, System.Object> |
Payload
Gets the payload of the message
Declaration
object Payload { get; }
Property Value
Type | Description |
---|---|
System.Object |
Methods
| Edit this page View SourceBuild()
Build the message
Declaration
IMessage Build()
Returns
Type | Description |
---|---|
IMessage | the message |
CopyHeaders(IDictionary<String, Object>)
Adds the headers to the message overwriting any existing values.
Declaration
IMessageBuilder CopyHeaders(IDictionary<string, object> headersToCopy)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | headersToCopy | the headers to add |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
CopyHeadersIfAbsent(IDictionary<String, Object>)
Adds the headers to the message but will not overwrite any existing values.
Declaration
IMessageBuilder CopyHeadersIfAbsent(IDictionary<string, object> headersToCopy)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<System.String, System.Object> | headersToCopy | the headers to add |
Returns
Type | Description |
---|---|
IMessageBuilder | 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 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 | the builder |
PopSequenceDetails()
Removes a sequence details header from the message
Declaration
IMessageBuilder PopSequenceDetails()
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
PushSequenceDetails(Object, Int32, Int32)
Adds a sequence details header to the message
Declaration
IMessageBuilder 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 | the builder |
RemoveHeader(String)
Remove the header if present
Declaration
IMessageBuilder RemoveHeader(string headerName)
Parameters
Type | Name | Description |
---|---|---|
System.String | headerName | the name of the header to remove |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
RemoveHeaders(String[])
Remove the headers matched by the header patterns from the message
Declaration
IMessageBuilder RemoveHeaders(params string[] headerPatterns)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | headerPatterns | header patterns to match |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetCorrelationId(Object)
Adds the correlationId to the headers
Declaration
IMessageBuilder SetCorrelationId(object correlationId)
Parameters
Type | Name | Description |
---|---|---|
System.Object | correlationId | the id to add |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetErrorChannel(IMessageChannel)
Adds an error channel to the messsage
Declaration
IMessageBuilder SetErrorChannel(IMessageChannel errorChannel)
Parameters
Type | Name | Description |
---|---|---|
IMessageChannel | errorChannel | the error channel |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetErrorChannelName(String)
Adds an error channel name to the message
Declaration
IMessageBuilder SetErrorChannelName(string errorChannelName)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorChannelName | the name of the error channel |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetExpirationDate(Int64)
Adds an expiration date in the headers
Declaration
IMessageBuilder SetExpirationDate(long expirationDate)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | expirationDate | expiration date added to header |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetExpirationDate(Nullable<DateTime>)
Adds an expiration date in the headers
Declaration
IMessageBuilder SetExpirationDate(DateTime? expirationDate)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<DateTime> | expirationDate | expiration date added to header |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetHeader(String, Object)
Add a header and value to the message
Declaration
IMessageBuilder 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 | the builder |
SetHeaderIfAbsent(String, Object)
Add a header and value to the message if not present
Declaration
IMessageBuilder 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 | the builder |
SetPriority(Int32)
Adds a priority header to the message
Declaration
IMessageBuilder SetPriority(int priority)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | priority | the priority to add |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetReplyChannel(IMessageChannel)
Adds a reply channel to the message
Declaration
IMessageBuilder SetReplyChannel(IMessageChannel replyChannel)
Parameters
Type | Name | Description |
---|---|---|
IMessageChannel | replyChannel | the reply channel |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetReplyChannelName(String)
Adds a reply channel name to the message
Declaration
IMessageBuilder SetReplyChannelName(string replyChannelName)
Parameters
Type | Name | Description |
---|---|---|
System.String | replyChannelName | the reply channel name |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetSequenceNumber(Int32)
Adds sequence details header to the message
Declaration
IMessageBuilder SetSequenceNumber(int sequenceNumber)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sequenceNumber | the sequence number |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |
SetSequenceSize(Int32)
Sets the size of the sequence number
Declaration
IMessageBuilder SetSequenceSize(int sequenceSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sequenceSize | the size |
Returns
Type | Description |
---|---|
IMessageBuilder | the builder |