Table of Contents

Interface IMessageBuilder<T>

Namespace
Steeltoe.Integration.Support
Assembly
Steeltoe.Integration.Abstractions.dll

A typed MessageBuilder.

public interface IMessageBuilder<T> : IMessageBuilder

Type Parameters

T

the type of the payload

Inherited Members

Properties

Payload

Gets the payload of the message

T Payload { get; }

Property Value

T

Methods

Build()

Build the message

IMessage<T> Build()

Returns

IMessage<T>

the message

CopyHeaders(IDictionary<string, object>)

Adds the headers to the message overwriting any existing values.

IMessageBuilder<T> CopyHeaders(IDictionary<string, object> headersToCopy)

Parameters

headersToCopy IDictionary<string, object>

the headers to add

Returns

IMessageBuilder<T>

the builder

CopyHeadersIfAbsent(IDictionary<string, object>)

Adds the headers to the message but will not overwrite any existing values.

IMessageBuilder<T> CopyHeadersIfAbsent(IDictionary<string, object> headersToCopy)

Parameters

headersToCopy IDictionary<string, object>

the headers to add

Returns

IMessageBuilder<T>

the builder

FilterAndCopyHeadersIfAbsent(IDictionary<string, object>, params string[])

Remove headers from the provided map matching to the provided pattens and only after that copy the result into the target message headers.

IMessageBuilder<T> FilterAndCopyHeadersIfAbsent(IDictionary<string, object> headersToCopy, params string[] headerPatternsToFilter)

Parameters

headersToCopy IDictionary<string, object>

the set of headers to copy

headerPatternsToFilter string[]

header patterns to filter before copy

Returns

IMessageBuilder<T>

the builder

PopSequenceDetails()

Removes a sequence details header from the message

IMessageBuilder<T> PopSequenceDetails()

Returns

IMessageBuilder<T>

the builder

PushSequenceDetails(object, int, int)

Adds a sequence details header to the message

IMessageBuilder<T> PushSequenceDetails(object correlationId, int sequenceNumber, int sequenceSize)

Parameters

correlationId object

correlation id to use in sequence

sequenceNumber int

the sequence number

sequenceSize int

the size of the sequence number

Returns

IMessageBuilder<T>

the builder

RemoveHeader(string)

Remove the header if present

IMessageBuilder<T> RemoveHeader(string headerName)

Parameters

headerName string

the name of the header to remove

Returns

IMessageBuilder<T>

the builder

RemoveHeaders(params string[])

Remove the headers matched by the header patterns from the message

IMessageBuilder<T> RemoveHeaders(params string[] headerPatterns)

Parameters

headerPatterns string[]

header patterns to match

Returns

IMessageBuilder<T>

the builder

SetCorrelationId(object)

Adds the correlationId to the headers

IMessageBuilder<T> SetCorrelationId(object correlationId)

Parameters

correlationId object

the id to add

Returns

IMessageBuilder<T>

the builder

SetErrorChannel(IMessageChannel)

Adds an error channel to the messsage

IMessageBuilder<T> SetErrorChannel(IMessageChannel errorChannel)

Parameters

errorChannel IMessageChannel

the error channel

Returns

IMessageBuilder<T>

the builder

SetErrorChannelName(string)

Adds an error channel name to the message

IMessageBuilder<T> SetErrorChannelName(string errorChannelName)

Parameters

errorChannelName string

the name of the error channel

Returns

IMessageBuilder<T>

the builder

SetExpirationDate(long)

Adds an expiration date in the headers

IMessageBuilder<T> SetExpirationDate(long expirationDate)

Parameters

expirationDate long

expiration date added to header

Returns

IMessageBuilder<T>

the builder

SetExpirationDate(DateTime?)

Adds an expiration date in the headers

IMessageBuilder<T> SetExpirationDate(DateTime? expirationDate)

Parameters

expirationDate DateTime?

expiration date added to header

Returns

IMessageBuilder<T>

the builder

SetHeader(string, object)

Add a header and value to the message

IMessageBuilder<T> SetHeader(string headerName, object headerValue)

Parameters

headerName string

name of the header

headerValue object

value of the header item

Returns

IMessageBuilder<T>

the builder

SetHeaderIfAbsent(string, object)

Add a header and value to the message if not present

IMessageBuilder<T> SetHeaderIfAbsent(string headerName, object headerValue)

Parameters

headerName string

name of the header

headerValue object

value of the header item

Returns

IMessageBuilder<T>

the builder

SetPriority(int)

Adds a priority header to the message

IMessageBuilder<T> SetPriority(int priority)

Parameters

priority int

the priority to add

Returns

IMessageBuilder<T>

the builder

SetReplyChannel(IMessageChannel)

Adds a reply channel to the message

IMessageBuilder<T> SetReplyChannel(IMessageChannel replyChannel)

Parameters

replyChannel IMessageChannel

the reply channel

Returns

IMessageBuilder<T>

the builder

SetReplyChannelName(string)

Adds a reply channel name to the message

IMessageBuilder<T> SetReplyChannelName(string replyChannelName)

Parameters

replyChannelName string

the reply channel name

Returns

IMessageBuilder<T>

the builder

SetSequenceNumber(int)

Adds sequence details header to the message

IMessageBuilder<T> SetSequenceNumber(int sequenceNumber)

Parameters

sequenceNumber int

the sequence number

Returns

IMessageBuilder<T>

the builder

SetSequenceSize(int)

Sets the size of the sequence number

IMessageBuilder<T> SetSequenceSize(int sequenceSize)

Parameters

sequenceSize int

the size

Returns

IMessageBuilder<T>

the builder