MessageBuilder¶
Provides an interface for building and sending messages to a STOMP broker.
Methods:¶
MessageBuilder WithContentType(String)¶
- Sets the content type for the message.
MessageBuilder WithHeader(String, String)¶
- Adds a custom header to the message.
WithAcknowledgmentCallback(Client, IncomingFrame})¶
- Sets a callback to be invoked upon acknowledgment of the message. When the message is sent in scope of a transaction, the callback will be called ONLY when the transaction is committed!
MessageBuilder WithContent(String)¶
- Sets the content of the message as a string. It also sets the
Content-Type
header totext/plain;charset=utf-8
! If a differentContent-Type
should be set, call WithContentType after this call.
WithContent(Byte[])¶
- Sets the content of the message as a byte array.
WithContent(Byte[], Int32, Int32)¶
- Sets the content of the message as a byte array with specified offset and count.
MessageBuilder WithContent(BufferSegment, Boolean)¶
- Sets the content of the message using a BufferSegment.
MessageBuilder WithTransaction(Transaction)¶
- Associates the message with a transaction.
Void BeginSend()¶
- Begins sending the message to the broker.
Task<ValueTuple<Client, IncomingFrame>> SendAsync()¶
- Begins sending the message to the broker.