Interface MessageAttribute

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
MessageAttribute.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:38.158Z") @Stability(Stable) public interface MessageAttribute extends software.amazon.jsii.JsiiSerializable
A message attribute to add to the SNS message.

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

See Also: