Table of Contents

Interface IMessageBuilder

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

A message builder that creates immutable GenericMessages.

public interface IMessageBuilder

Properties

Headers

Gets the current headers of the message

IDictionary<string, object> Headers { get; }

Property Value

IDictionary<string, object>

Payload

Gets the payload of the message

object Payload { get; }

Property Value

object

Methods

Build()

Build the message

IMessage Build()

Returns

IMessage

the message

CopyHeaders(IDictionary<string, object>)

Adds the headers to the message overwriting any existing values.

IMessageBuilder CopyHeaders(IDictionary<string, object> headersToCopy)

Parameters

headersToCopy IDictionary<string, object>

the headers to add

Returns

IMessageBuilder

the builder

CopyHeadersIfAbsent(IDictionary<string, object>)

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

IMessageBuilder CopyHeadersIfAbsent(IDictionary<string, object> headersToCopy)

Parameters

headersToCopy IDictionary<string, object>

the headers to add

Returns

IMessageBuilder

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 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

the builder

PopSequenceDetails()

Removes a sequence details header from the message

IMessageBuilder PopSequenceDetails()

Returns

IMessageBuilder

the builder

PushSequenceDetails(object, int, int)

Adds a sequence details header to the message

IMessageBuilder 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

the builder

RemoveHeader(string)

Remove the header if present

IMessageBuilder RemoveHeader(string headerName)

Parameters

headerName string

the name of the header to remove

Returns

IMessageBuilder

the builder

RemoveHeaders(params string[])

Remove the headers matched by the header patterns from the message

IMessageBuilder RemoveHeaders(params string[] headerPatterns)

Parameters

headerPatterns string[]

header patterns to match

Returns

IMessageBuilder

the builder

SetCorrelationId(object)

Adds the correlationId to the headers

IMessageBuilder SetCorrelationId(object correlationId)

Parameters

correlationId object

the id to add

Returns

IMessageBuilder

the builder

SetErrorChannel(IMessageChannel)

Adds an error channel to the messsage

IMessageBuilder SetErrorChannel(IMessageChannel errorChannel)

Parameters

errorChannel IMessageChannel

the error channel

Returns

IMessageBuilder

the builder

SetErrorChannelName(string)

Adds an error channel name to the message

IMessageBuilder SetErrorChannelName(string errorChannelName)

Parameters

errorChannelName string

the name of the error channel

Returns

IMessageBuilder

the builder

SetExpirationDate(long)

Adds an expiration date in the headers

IMessageBuilder SetExpirationDate(long expirationDate)

Parameters

expirationDate long

expiration date added to header

Returns

IMessageBuilder

the builder

SetExpirationDate(DateTime?)

Adds an expiration date in the headers

IMessageBuilder SetExpirationDate(DateTime? expirationDate)

Parameters

expirationDate DateTime?

expiration date added to header

Returns

IMessageBuilder

the builder

SetHeader(string, object)

Add a header and value to the message

IMessageBuilder SetHeader(string headerName, object headerValue)

Parameters

headerName string

name of the header

headerValue object

value of the header item

Returns

IMessageBuilder

the builder

SetHeaderIfAbsent(string, object)

Add a header and value to the message if not present

IMessageBuilder SetHeaderIfAbsent(string headerName, object headerValue)

Parameters

headerName string

name of the header

headerValue object

value of the header item

Returns

IMessageBuilder

the builder

SetPriority(int)

Adds a priority header to the message

IMessageBuilder SetPriority(int priority)

Parameters

priority int

the priority to add

Returns

IMessageBuilder

the builder

SetReplyChannel(IMessageChannel)

Adds a reply channel to the message

IMessageBuilder SetReplyChannel(IMessageChannel replyChannel)

Parameters

replyChannel IMessageChannel

the reply channel

Returns

IMessageBuilder

the builder

SetReplyChannelName(string)

Adds a reply channel name to the message

IMessageBuilder SetReplyChannelName(string replyChannelName)

Parameters

replyChannelName string

the reply channel name

Returns

IMessageBuilder

the builder

SetSequenceNumber(int)

Adds sequence details header to the message

IMessageBuilder SetSequenceNumber(int sequenceNumber)

Parameters

sequenceNumber int

the sequence number

Returns

IMessageBuilder

the builder

SetSequenceSize(int)

Sets the size of the sequence number

IMessageBuilder SetSequenceSize(int sequenceSize)

Parameters

sequenceSize int

the size

Returns

IMessageBuilder

the builder