Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

IMessageBuilder* attachment(com.amazon.apmf.IDataObject* obj)
Adds an attachment to the message, which all recipients may extract using 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()

IMessageBuilder* messageProperties(IMessageProperties* properties)
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.

Parameters

properties
IMessageProperties* — Required The properties to include with the message.

Returns

IMessageBuilder* An IMessageBuilder instance that can be used for further calls.

redirectResponse()

IMessageBuilder* redirectResponse(string responseUri)
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 originating 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()

IMessage* build()
Builds a message with the configured builder attributes. May be called multiple times to build multiple messages.

Returns

IMessage* An IMessage instance to use with IMessagingModule::send().
Last modified on October 29, 2026