withHeader

open fun withHeader(key: String, value: String): SOURCE

Adds a key-value pair to the message header and returns the message itself for method chaining.

Return

The message itself, allowing for method chaining.

Parameters

key

The key of the header.

value

The value of the header.


open fun withHeader(additionalSource: Map<String, String>): SOURCE

Adds all entries from the provided map to the message header and returns the message itself for method chaining.

Return

The message itself, allowing for method chaining.

Parameters

additionalSource

A map containing key-value pairs to be added to the header.