spring-framework / org.springframework.messaging.support / MessageBuilder / createMessage

createMessage

static fun <T : Any> createMessage(@Nullable payload: T, messageHeaders: MessageHeaders): Message<T>

A shortcut factory method for creating a message with the given payload and MessageHeaders.

Note: the given MessageHeaders instance is used directly in the new message, i.e. it is not copied.

Parameters

payload - the payload to use (never null)

messageHeaders - the headers to use (never null)

Return
the created message

Since
4.1