Interface IMessage

Assembly: redb.Route.dll

Represents a message flowing through the route pipeline.
Contains payload (Body), metadata (Headers), and supports both
C# idiomatic properties and Java-style methods for backward compatibility.

public interface IMessage

Properties

Attachments

Attachments of this message (Apache Camel's AttachmentMessage): named content beside the body, such as the

IMessageAttachments Attachments { get; }

Body

Message payload. Can be any object or null.

object? Body { get; set; }

ContentType

MIME content type of the message body (e.g. "application/json").

string? ContentType { get; set; }

Headers

Headers that travel with the message (ContentType, CorrelationId, custom).

IDictionary<string, object?> Headers { get; }

Methods

Clone()

Structural copy of the message. Headers get a new dictionary, but the

IMessage Clone()

copy()

Java-style: deep copy (alias for Clone).

IMessage copy()

getBody()

Java-style: returns Body.

object? getBody()

getBody<T>()

Java-style: returns Body cast to T.

T? getBody<T>()

getContentType()

Java-style: returns ContentType.

string? getContentType()

getHeader(string)

Java-style: returns header value by key.

object? getHeader(string key)

getHeader<T>(string)

Java-style: returns header value cast to T.

T? getHeader<T>(string key)

GetHeader<T>(string)

Gets a header value with type conversion.

T? GetHeader<T>(string key)

getHeaders()

Java-style: returns Headers dictionary.

IDictionary<string, object?> getHeaders()

removeHeader(string)

Java-style: removes a header by key.

void removeHeader(string key)

setBody(object?)

Java-style: sets Body.

void setBody(object? value)

setContentType(string?)

Java-style: sets ContentType.

void setContentType(string? value)

setHeader(string, object?)

Java-style: sets header value.

void setHeader(string key, object? value)

Snapshot()

Deep, isolated copy for checkpoint/replay: like but the

IMessage Snapshot()