Interface IMessageBuilder
interface IMessageBuilder
Extends com.amazon.apmf.IStandard
Builds IMessage instances bound to a specific target URI. Supports
attaching payloads, message properties, and response expectations. The
builder is reusable for constructing multiple messages with the same
target URI.
Methods
attachment()
Adds an attachment to the message, which all recipients may extract usingIMessageBuilder*attachment(com.amazon.apmf.IDataObject*obj)
IMessage::getAttachmentBytes(). Calling this multiple times
will overwrite an existing attachment.
Parameters
obj
com.amazon.apmf.IDataObject* — Required
The attachment to include with the message.
Returns
IMessageBuilder*
An IMessageBuilder instance that can be used for further
calls.
messageProperties()
Sets optional message properties. In contrast to client defined attachment, Message Properties are predefined in this IDL and the values may be used by the system or the app.IMessageBuilder*messageProperties(IMessageProperties*properties)
Parameters
properties
IMessageProperties* — Required
The properties to include with the message.
Returns
IMessageBuilder*
An IMessageBuilder instance that can be used for further
calls.
redirectResponse()
Indicates that a response to this message is required and redirects that response to a specific lifecycle component instead of the listener supplied to the originatingIMessageBuilder*redirectResponse(stringresponseUri)
IMessagingModule::send() call. Both the message sender and
recipient must have the right privileges to directly launch the
lifecycle component.
Parameters
responseUri
string — Required
The URI of the target to which to direct
responses.
Returns
IMessageBuilder*
An IMessageBuilder instance that can be used for further
calls.
build()
Builds a message with the configured builder attributes. May be called multiple times to build multiple messages.IMessage*build()
Returns
IMessage*
An IMessage instance to use with IMessagingModule::send().

