@Generated(value="jsii-pacmak/1.72.0 (build 4b8828b)", date="2022-12-27T20:28:49.375Z") @Stability(value=Stable) public interface MessageAttribute extends software.amazon.jsii.JsiiSerializable
Example:
Topic topic = new Topic(this, "Topic");
// Use a field from the execution data as message.
SnsPublish task1 = SnsPublish.Builder.create(this, "Publish1")
.topic(topic)
.integrationPattern(IntegrationPattern.REQUEST_RESPONSE)
.message(TaskInput.fromDataAt("$.state.message"))
.messageAttributes(Map.of(
"place", MessageAttribute.builder()
.value(JsonPath.stringAt("$.place"))
.build(),
"pic", MessageAttribute.builder()
// BINARY must be explicitly set
.dataType(MessageAttributeDataType.BINARY)
.value(JsonPath.stringAt("$.pic"))
.build(),
"people", MessageAttribute.builder()
.value(4)
.build(),
"handles", MessageAttribute.builder()
.value(List.of("@kslater", "@jjf", null, "@mfanning"))
.build()))
.build();
// Combine a field from the execution data with
// a literal object.
SnsPublish task2 = SnsPublish.Builder.create(this, "Publish2")
.topic(topic)
.message(TaskInput.fromObject(Map.of(
"field1", "somedata",
"field2", JsonPath.stringAt("$.field2"))))
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
MessageAttribute.Builder
A builder for
MessageAttribute |
static class |
MessageAttribute.Jsii$Proxy
An implementation for
MessageAttribute |
| Modifier and Type | Method and Description |
|---|---|
static MessageAttribute.Builder |
builder() |
default MessageAttributeDataType |
getDataType()
The data type for the attribute.
|
Object |
getValue()
The value of the attribute.
|
@Stability(value=Stable) @NotNull Object getValue()
@Stability(value=Stable) @Nullable default MessageAttributeDataType getDataType()
Default: determined by type inspection if possible, fallback is String
@Stability(value=Stable) static MessageAttribute.Builder builder()
MessageAttribute.Builder of MessageAttributeCopyright © 2022. All rights reserved.