@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.531Z") @Stability(value=Stable) public enum MessageAttributeDataType extends Enum<MessageAttributeDataType>
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();
| Enum Constant and Description |
|---|
BINARY
Binary type attributes can store any binary data.
|
NUMBER
Numbers are positive or negative integers or floating-point numbers.
|
STRING
Strings are Unicode with UTF-8 binary encoding.
|
STRING_ARRAY
An array, formatted as a string.
|
| Modifier and Type | Method and Description |
|---|---|
static MessageAttributeDataType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MessageAttributeDataType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
@Stability(value=Stable) public static final MessageAttributeDataType STRING
@Stability(value=Stable) public static final MessageAttributeDataType STRING_ARRAY
@Stability(value=Stable) public static final MessageAttributeDataType NUMBER
@Stability(value=Stable) public static final MessageAttributeDataType BINARY
public static MessageAttributeDataType[] values()
for (MessageAttributeDataType c : MessageAttributeDataType.values()) System.out.println(c);
public static MessageAttributeDataType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.