@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:50.361Z") public enum MessageAttributeDataType extends java.lang.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(java.lang.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.
|
public static final MessageAttributeDataType STRING
public static final MessageAttributeDataType STRING_ARRAY
public static final MessageAttributeDataType NUMBER
public static final MessageAttributeDataType BINARY
public static MessageAttributeDataType[] values()
for (MessageAttributeDataType c : MessageAttributeDataType.values()) System.out.println(c);
public static MessageAttributeDataType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null