All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sqs.model.SendMessageBatchRequestEntry Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SQS module holds the client classes that are used for communicating with Amazon Simple Queue Service

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.sqs.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Contains the details of a single Amazon SQS message along with an Id. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SendMessageBatchRequestEntry implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id") .getter(getter(SendMessageBatchRequestEntry::id)).setter(setter(Builder::id)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build(); private static final SdkField MESSAGE_BODY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MessageBody").getter(getter(SendMessageBatchRequestEntry::messageBody)) .setter(setter(Builder::messageBody)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageBody").build()).build(); private static final SdkField DELAY_SECONDS_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("DelaySeconds").getter(getter(SendMessageBatchRequestEntry::delaySeconds)) .setter(setter(Builder::delaySeconds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DelaySeconds").build()).build(); private static final SdkField> MESSAGE_ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("MessageAttributes") .getter(getter(SendMessageBatchRequestEntry::messageAttributes)) .setter(setter(Builder::messageAttributes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageAttributes").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(MessageAttributeValue::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).isFlattened(true).build()).build(); private static final SdkField> MESSAGE_SYSTEM_ATTRIBUTES_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("MessageSystemAttributes") .getter(getter(SendMessageBatchRequestEntry::messageSystemAttributesAsStrings)) .setter(setter(Builder::messageSystemAttributesWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageSystemAttributes").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(MessageSystemAttributeValue::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).isFlattened(true).build()).build(); private static final SdkField MESSAGE_DEDUPLICATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MessageDeduplicationId").getter(getter(SendMessageBatchRequestEntry::messageDeduplicationId)) .setter(setter(Builder::messageDeduplicationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageDeduplicationId").build()) .build(); private static final SdkField MESSAGE_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MessageGroupId").getter(getter(SendMessageBatchRequestEntry::messageGroupId)) .setter(setter(Builder::messageGroupId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MessageGroupId").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_FIELD, MESSAGE_BODY_FIELD, DELAY_SECONDS_FIELD, MESSAGE_ATTRIBUTES_FIELD, MESSAGE_SYSTEM_ATTRIBUTES_FIELD, MESSAGE_DEDUPLICATION_ID_FIELD, MESSAGE_GROUP_ID_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("Id", ID_FIELD); put("MessageBody", MESSAGE_BODY_FIELD); put("DelaySeconds", DELAY_SECONDS_FIELD); put("MessageAttributes", MESSAGE_ATTRIBUTES_FIELD); put("MessageSystemAttributes", MESSAGE_SYSTEM_ATTRIBUTES_FIELD); put("MessageDeduplicationId", MESSAGE_DEDUPLICATION_ID_FIELD); put("MessageGroupId", MESSAGE_GROUP_ID_FIELD); } }); private static final long serialVersionUID = 1L; private final String id; private final String messageBody; private final Integer delaySeconds; private final Map messageAttributes; private final Map messageSystemAttributes; private final String messageDeduplicationId; private final String messageGroupId; private SendMessageBatchRequestEntry(BuilderImpl builder) { this.id = builder.id; this.messageBody = builder.messageBody; this.delaySeconds = builder.delaySeconds; this.messageAttributes = builder.messageAttributes; this.messageSystemAttributes = builder.messageSystemAttributes; this.messageDeduplicationId = builder.messageDeduplicationId; this.messageGroupId = builder.messageGroupId; } /** *

* An identifier for a message in this batch used to communicate the result. *

* *

* The Ids of a batch request need to be unique within a request. *

*

* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters, * hyphens(-), and underscores (_). *

*
* * @return An identifier for a message in this batch used to communicate the result.

*

* The Ids of a batch request need to be unique within a request. *

*

* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric * characters, hyphens(-), and underscores (_). *

*/ public final String id() { return id; } /** *

* The body of the message. *

* * @return The body of the message. */ public final String messageBody() { return messageBody; } /** *

* The length of time, in seconds, for which a specific message is delayed. Valid values: 0 to 900. Maximum: 15 * minutes. Messages with a positive DelaySeconds value become available for processing after the delay * period is finished. If you don't specify a value, the default value for the queue is applied. *

* *

* When you set FifoQueue, you can't set DelaySeconds per message. You can set this * parameter only on a queue level. *

*
* * @return The length of time, in seconds, for which a specific message is delayed. Valid values: 0 to 900. Maximum: * 15 minutes. Messages with a positive DelaySeconds value become available for processing * after the delay period is finished. If you don't specify a value, the default value for the queue is * applied.

*

* When you set FifoQueue, you can't set DelaySeconds per message. You can set * this parameter only on a queue level. *

*/ public final Integer delaySeconds() { return delaySeconds; } /** * For responses, this returns true if the service returned a value for the MessageAttributes property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasMessageAttributes() { return messageAttributes != null && !(messageAttributes instanceof SdkAutoConstructMap); } /** *

* Each message attribute consists of a Name, Type, and Value. For more * information, see Amazon SQS message attributes in the Amazon SQS Developer Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasMessageAttributes} method. *

* * @return Each message attribute consists of a Name, Type, and Value. For * more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide. */ public final Map messageAttributes() { return messageAttributes; } /** *

* The message system attribute to send Each message system attribute consists of a Name, * Type, and Value. *

* *
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must be * String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasMessageSystemAttributes} method. *

* * @return The message system attribute to send Each message system attribute consists of a Name, * Type, and Value.

*
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must be * String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
*/ public final Map messageSystemAttributes() { return MessageBodySystemAttributeMapCopier.copyStringToEnum(messageSystemAttributes); } /** * For responses, this returns true if the service returned a value for the MessageSystemAttributes property. This * DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the * property). This is useful because the SDK will never return a null collection or map, but you may need to * differentiate between the service returning nothing (or null) and the service returning an empty collection or * map. For requests, this returns true if a value for the property was specified in the request builder, and false * if a value was not specified. */ public final boolean hasMessageSystemAttributes() { return messageSystemAttributes != null && !(messageSystemAttributes instanceof SdkAutoConstructMap); } /** *

* The message system attribute to send Each message system attribute consists of a Name, * Type, and Value. *

* *
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must be * String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasMessageSystemAttributes} method. *

* * @return The message system attribute to send Each message system attribute consists of a Name, * Type, and Value.

*
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must be * String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
*/ public final Map messageSystemAttributesAsStrings() { return messageSystemAttributes; } /** *

* This parameter applies only to FIFO (first-in-first-out) queues. *

*

* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a message with * a particular MessageDeduplicationId is sent successfully, subsequent messages with the same * MessageDeduplicationId are accepted successfully but aren't delivered. For more information, see Exactly-once processing in the Amazon SQS Developer Guide. *

*
    *
  • *

    * Every message must have a unique MessageDeduplicationId, *

    *
      *
    • *

      * You may provide a MessageDeduplicationId explicitly. *

      *
    • *
    • *

      * If you aren't able to provide a MessageDeduplicationId and you enable * ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to generate the * MessageDeduplicationId using the body of the message (but not the attributes of the message). *

      *
    • *
    • *

      * If you don't provide a MessageDeduplicationId and the queue doesn't have * ContentBasedDeduplication set, the action fails with an error. *

      *
    • *
    • *

      * If the queue has ContentBasedDeduplication set, your MessageDeduplicationId overrides * the generated one. *

      *
    • *
    *
  • *
  • *

    * When ContentBasedDeduplication is in effect, messages with identical content sent within the * deduplication interval are treated as duplicates and only one copy of the message is delivered. *

    *
  • *
  • *

    * If you send one message with ContentBasedDeduplication enabled and then another message with a * MessageDeduplicationId that is the same as the one generated for the first * MessageDeduplicationId, the two messages are treated as duplicates and only one copy of the message * is delivered. *

    *
  • *
* *

* The MessageDeduplicationId is available to the consumer of the message (this can be useful for * troubleshooting delivery issues). *

*

* If a message is sent successfully but the acknowledgement is lost and the message is resent with the same * MessageDeduplicationId after the deduplication interval, Amazon SQS can't detect duplicate messages. *

*

* Amazon SQS continues to keep track of the message deduplication ID even after the message is received and * deleted. *

*
*

* The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId can * contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation ( * !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId Property in the Amazon SQS Developer Guide. *

* * @return This parameter applies only to FIFO (first-in-first-out) queues.

*

* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a * message with a particular MessageDeduplicationId is sent successfully, subsequent messages * with the same MessageDeduplicationId are accepted successfully but aren't delivered. For * more information, see Exactly-once processing in the Amazon SQS Developer Guide. *

*
    *
  • *

    * Every message must have a unique MessageDeduplicationId, *

    *
      *
    • *

      * You may provide a MessageDeduplicationId explicitly. *

      *
    • *
    • *

      * If you aren't able to provide a MessageDeduplicationId and you enable * ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to generate the * MessageDeduplicationId using the body of the message (but not the attributes of the * message). *

      *
    • *
    • *

      * If you don't provide a MessageDeduplicationId and the queue doesn't have * ContentBasedDeduplication set, the action fails with an error. *

      *
    • *
    • *

      * If the queue has ContentBasedDeduplication set, your MessageDeduplicationId * overrides the generated one. *

      *
    • *
    *
  • *
  • *

    * When ContentBasedDeduplication is in effect, messages with identical content sent within the * deduplication interval are treated as duplicates and only one copy of the message is delivered. *

    *
  • *
  • *

    * If you send one message with ContentBasedDeduplication enabled and then another message with * a MessageDeduplicationId that is the same as the one generated for the first * MessageDeduplicationId, the two messages are treated as duplicates and only one copy of the * message is delivered. *

    *
  • *
* *

* The MessageDeduplicationId is available to the consumer of the message (this can be useful * for troubleshooting delivery issues). *

*

* If a message is sent successfully but the acknowledgement is lost and the message is resent with the same * MessageDeduplicationId after the deduplication interval, Amazon SQS can't detect duplicate * messages. *

*

* Amazon SQS continues to keep track of the message deduplication ID even after the message is received and * deleted. *

*
*

* The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId * can contain alphanumeric characters (a-z, A-Z, 0-9) and * punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId Property in the Amazon SQS Developer Guide. */ public final String messageDeduplicationId() { return messageDeduplicationId; } /** *

* This parameter applies only to FIFO (first-in-first-out) queues. *

*

* The tag that specifies that a message belongs to a specific message group. Messages that belong to the same * message group are processed in a FIFO manner (however, messages in different message groups might be processed * out of order). To interleave multiple ordered streams within a single queue, use MessageGroupId * values (for example, session data for multiple users). In this scenario, multiple consumers can process the * queue, but the session data of each user is processed in a FIFO fashion. *

*
    *
  • *

    * You must associate a non-empty MessageGroupId with a message. If you don't provide a * MessageGroupId, the action fails. *

    *
  • *
  • *

    * ReceiveMessage might return messages with multiple MessageGroupId values. For each * MessageGroupId, the messages are sorted by time sent. The caller can't specify a * MessageGroupId. *

    *
  • *
*

* The length of MessageGroupId is 128 characters. Valid values: alphanumeric characters and * punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageGroupId, see Using the MessageGroupId Property in the Amazon SQS Developer Guide. *

* *

* MessageGroupId is required for FIFO queues. You can't use it for Standard queues. *

*
* * @return This parameter applies only to FIFO (first-in-first-out) queues.

*

* The tag that specifies that a message belongs to a specific message group. Messages that belong to the * same message group are processed in a FIFO manner (however, messages in different message groups might be * processed out of order). To interleave multiple ordered streams within a single queue, use * MessageGroupId values (for example, session data for multiple users). In this scenario, * multiple consumers can process the queue, but the session data of each user is processed in a FIFO * fashion. *

*
    *
  • *

    * You must associate a non-empty MessageGroupId with a message. If you don't provide a * MessageGroupId, the action fails. *

    *
  • *
  • *

    * ReceiveMessage might return messages with multiple MessageGroupId values. For * each MessageGroupId, the messages are sorted by time sent. The caller can't specify a * MessageGroupId. *

    *
  • *
*

* The length of MessageGroupId is 128 characters. Valid values: alphanumeric characters and * punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageGroupId, see Using the MessageGroupId Property in the Amazon SQS Developer Guide. *

* *

* MessageGroupId is required for FIFO queues. You can't use it for Standard queues. *

*/ public final String messageGroupId() { return messageGroupId; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(messageBody()); hashCode = 31 * hashCode + Objects.hashCode(delaySeconds()); hashCode = 31 * hashCode + Objects.hashCode(hasMessageAttributes() ? messageAttributes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasMessageSystemAttributes() ? messageSystemAttributesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(messageDeduplicationId()); hashCode = 31 * hashCode + Objects.hashCode(messageGroupId()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SendMessageBatchRequestEntry)) { return false; } SendMessageBatchRequestEntry other = (SendMessageBatchRequestEntry) obj; return Objects.equals(id(), other.id()) && Objects.equals(messageBody(), other.messageBody()) && Objects.equals(delaySeconds(), other.delaySeconds()) && hasMessageAttributes() == other.hasMessageAttributes() && Objects.equals(messageAttributes(), other.messageAttributes()) && hasMessageSystemAttributes() == other.hasMessageSystemAttributes() && Objects.equals(messageSystemAttributesAsStrings(), other.messageSystemAttributesAsStrings()) && Objects.equals(messageDeduplicationId(), other.messageDeduplicationId()) && Objects.equals(messageGroupId(), other.messageGroupId()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("SendMessageBatchRequestEntry").add("Id", id()).add("MessageBody", messageBody()) .add("DelaySeconds", delaySeconds()) .add("MessageAttributes", hasMessageAttributes() ? messageAttributes() : null) .add("MessageSystemAttributes", hasMessageSystemAttributes() ? messageSystemAttributesAsStrings() : null) .add("MessageDeduplicationId", messageDeduplicationId()).add("MessageGroupId", messageGroupId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Id": return Optional.ofNullable(clazz.cast(id())); case "MessageBody": return Optional.ofNullable(clazz.cast(messageBody())); case "DelaySeconds": return Optional.ofNullable(clazz.cast(delaySeconds())); case "MessageAttributes": return Optional.ofNullable(clazz.cast(messageAttributes())); case "MessageSystemAttributes": return Optional.ofNullable(clazz.cast(messageSystemAttributesAsStrings())); case "MessageDeduplicationId": return Optional.ofNullable(clazz.cast(messageDeduplicationId())); case "MessageGroupId": return Optional.ofNullable(clazz.cast(messageGroupId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((SendMessageBatchRequestEntry) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* An identifier for a message in this batch used to communicate the result. *

* *

* The Ids of a batch request need to be unique within a request. *

*

* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters, * hyphens(-), and underscores (_). *

*
* * @param id * An identifier for a message in this batch used to communicate the result.

*

* The Ids of a batch request need to be unique within a request. *

*

* This identifier can have up to 80 characters. The following characters are accepted: alphanumeric * characters, hyphens(-), and underscores (_). *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* The body of the message. *

* * @param messageBody * The body of the message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder messageBody(String messageBody); /** *

* The length of time, in seconds, for which a specific message is delayed. Valid values: 0 to 900. Maximum: 15 * minutes. Messages with a positive DelaySeconds value become available for processing after the * delay period is finished. If you don't specify a value, the default value for the queue is applied. *

* *

* When you set FifoQueue, you can't set DelaySeconds per message. You can set this * parameter only on a queue level. *

*
* * @param delaySeconds * The length of time, in seconds, for which a specific message is delayed. Valid values: 0 to 900. * Maximum: 15 minutes. Messages with a positive DelaySeconds value become available for * processing after the delay period is finished. If you don't specify a value, the default value for the * queue is applied.

*

* When you set FifoQueue, you can't set DelaySeconds per message. You can set * this parameter only on a queue level. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder delaySeconds(Integer delaySeconds); /** *

* Each message attribute consists of a Name, Type, and Value. For more * information, see Amazon SQS message attributes in the Amazon SQS Developer Guide. *

* * @param messageAttributes * Each message attribute consists of a Name, Type, and Value. For * more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder messageAttributes(Map messageAttributes); /** *

* The message system attribute to send Each message system attribute consists of a Name, * Type, and Value. *

* *
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must be * String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
*
* * @param messageSystemAttributes * The message system attribute to send Each message system attribute consists of a Name, * Type, and Value.

*
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must * be String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
* @return Returns a reference to this object so that method calls can be chained together. */ Builder messageSystemAttributesWithStrings(Map messageSystemAttributes); /** *

* The message system attribute to send Each message system attribute consists of a Name, * Type, and Value. *

* *
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must be * String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
*
* * @param messageSystemAttributes * The message system attribute to send Each message system attribute consists of a Name, * Type, and Value.

*
    *
  • *

    * Currently, the only supported message system attribute is AWSTraceHeader. Its type must * be String and its value must be a correctly formatted X-Ray trace header string. *

    *
  • *
  • *

    * The size of a message system attribute doesn't count towards the total size of a message. *

    *
  • *
* @return Returns a reference to this object so that method calls can be chained together. */ Builder messageSystemAttributes( Map messageSystemAttributes); /** *

* This parameter applies only to FIFO (first-in-first-out) queues. *

*

* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a message * with a particular MessageDeduplicationId is sent successfully, subsequent messages with the same * MessageDeduplicationId are accepted successfully but aren't delivered. For more information, see * Exactly-once processing in the Amazon SQS Developer Guide. *

*
    *
  • *

    * Every message must have a unique MessageDeduplicationId, *

    *
      *
    • *

      * You may provide a MessageDeduplicationId explicitly. *

      *
    • *
    • *

      * If you aren't able to provide a MessageDeduplicationId and you enable * ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to generate the * MessageDeduplicationId using the body of the message (but not the attributes of the message). *

      *
    • *
    • *

      * If you don't provide a MessageDeduplicationId and the queue doesn't have * ContentBasedDeduplication set, the action fails with an error. *

      *
    • *
    • *

      * If the queue has ContentBasedDeduplication set, your MessageDeduplicationId * overrides the generated one. *

      *
    • *
    *
  • *
  • *

    * When ContentBasedDeduplication is in effect, messages with identical content sent within the * deduplication interval are treated as duplicates and only one copy of the message is delivered. *

    *
  • *
  • *

    * If you send one message with ContentBasedDeduplication enabled and then another message with a * MessageDeduplicationId that is the same as the one generated for the first * MessageDeduplicationId, the two messages are treated as duplicates and only one copy of the * message is delivered. *

    *
  • *
* *

* The MessageDeduplicationId is available to the consumer of the message (this can be useful for * troubleshooting delivery issues). *

*

* If a message is sent successfully but the acknowledgement is lost and the message is resent with the same * MessageDeduplicationId after the deduplication interval, Amazon SQS can't detect duplicate * messages. *

*

* Amazon SQS continues to keep track of the message deduplication ID even after the message is received and * deleted. *

*
*

* The length of MessageDeduplicationId is 128 characters. MessageDeduplicationId can * contain alphanumeric characters (a-z, A-Z, 0-9) and punctuation ( * !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId Property in the Amazon SQS Developer Guide. *

* * @param messageDeduplicationId * This parameter applies only to FIFO (first-in-first-out) queues.

*

* The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a * message with a particular MessageDeduplicationId is sent successfully, subsequent * messages with the same MessageDeduplicationId are accepted successfully but aren't * delivered. For more information, see Exactly-once processing in the Amazon SQS Developer Guide. *

*
    *
  • *

    * Every message must have a unique MessageDeduplicationId, *

    *
      *
    • *

      * You may provide a MessageDeduplicationId explicitly. *

      *
    • *
    • *

      * If you aren't able to provide a MessageDeduplicationId and you enable * ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash to generate the * MessageDeduplicationId using the body of the message (but not the attributes of the * message). *

      *
    • *
    • *

      * If you don't provide a MessageDeduplicationId and the queue doesn't have * ContentBasedDeduplication set, the action fails with an error. *

      *
    • *
    • *

      * If the queue has ContentBasedDeduplication set, your MessageDeduplicationId * overrides the generated one. *

      *
    • *
    *
  • *
  • *

    * When ContentBasedDeduplication is in effect, messages with identical content sent within * the deduplication interval are treated as duplicates and only one copy of the message is delivered. *

    *
  • *
  • *

    * If you send one message with ContentBasedDeduplication enabled and then another message * with a MessageDeduplicationId that is the same as the one generated for the first * MessageDeduplicationId, the two messages are treated as duplicates and only one copy of * the message is delivered. *

    *
  • *
* *

* The MessageDeduplicationId is available to the consumer of the message (this can be * useful for troubleshooting delivery issues). *

*

* If a message is sent successfully but the acknowledgement is lost and the message is resent with the * same MessageDeduplicationId after the deduplication interval, Amazon SQS can't detect * duplicate messages. *

*

* Amazon SQS continues to keep track of the message deduplication ID even after the message is received * and deleted. *

*
*

* The length of MessageDeduplicationId is 128 characters. * MessageDeduplicationId can contain alphanumeric characters (a-z, * A-Z, 0-9) and punctuation ( * !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageDeduplicationId, see Using the MessageDeduplicationId Property in the Amazon SQS Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder messageDeduplicationId(String messageDeduplicationId); /** *

* This parameter applies only to FIFO (first-in-first-out) queues. *

*

* The tag that specifies that a message belongs to a specific message group. Messages that belong to the same * message group are processed in a FIFO manner (however, messages in different message groups might be * processed out of order). To interleave multiple ordered streams within a single queue, use * MessageGroupId values (for example, session data for multiple users). In this scenario, multiple * consumers can process the queue, but the session data of each user is processed in a FIFO fashion. *

*
    *
  • *

    * You must associate a non-empty MessageGroupId with a message. If you don't provide a * MessageGroupId, the action fails. *

    *
  • *
  • *

    * ReceiveMessage might return messages with multiple MessageGroupId values. For each * MessageGroupId, the messages are sorted by time sent. The caller can't specify a * MessageGroupId. *

    *
  • *
*

* The length of MessageGroupId is 128 characters. Valid values: alphanumeric characters and * punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageGroupId, see Using the MessageGroupId Property in the Amazon SQS Developer Guide. *

* *

* MessageGroupId is required for FIFO queues. You can't use it for Standard queues. *

*
* * @param messageGroupId * This parameter applies only to FIFO (first-in-first-out) queues.

*

* The tag that specifies that a message belongs to a specific message group. Messages that belong to the * same message group are processed in a FIFO manner (however, messages in different message groups might * be processed out of order). To interleave multiple ordered streams within a single queue, use * MessageGroupId values (for example, session data for multiple users). In this scenario, * multiple consumers can process the queue, but the session data of each user is processed in a FIFO * fashion. *

*
    *
  • *

    * You must associate a non-empty MessageGroupId with a message. If you don't provide a * MessageGroupId, the action fails. *

    *
  • *
  • *

    * ReceiveMessage might return messages with multiple MessageGroupId values. * For each MessageGroupId, the messages are sorted by time sent. The caller can't specify a * MessageGroupId. *

    *
  • *
*

* The length of MessageGroupId is 128 characters. Valid values: alphanumeric characters and * punctuation (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~). *

*

* For best practices of using MessageGroupId, see Using the MessageGroupId Property in the Amazon SQS Developer Guide. *

* *

* MessageGroupId is required for FIFO queues. You can't use it for Standard queues. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder messageGroupId(String messageGroupId); } static final class BuilderImpl implements Builder { private String id; private String messageBody; private Integer delaySeconds; private Map messageAttributes = DefaultSdkAutoConstructMap.getInstance(); private Map messageSystemAttributes = DefaultSdkAutoConstructMap.getInstance(); private String messageDeduplicationId; private String messageGroupId; private BuilderImpl() { } private BuilderImpl(SendMessageBatchRequestEntry model) { id(model.id); messageBody(model.messageBody); delaySeconds(model.delaySeconds); messageAttributes(model.messageAttributes); messageSystemAttributesWithStrings(model.messageSystemAttributes); messageDeduplicationId(model.messageDeduplicationId); messageGroupId(model.messageGroupId); } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getMessageBody() { return messageBody; } public final void setMessageBody(String messageBody) { this.messageBody = messageBody; } @Override public final Builder messageBody(String messageBody) { this.messageBody = messageBody; return this; } public final Integer getDelaySeconds() { return delaySeconds; } public final void setDelaySeconds(Integer delaySeconds) { this.delaySeconds = delaySeconds; } @Override public final Builder delaySeconds(Integer delaySeconds) { this.delaySeconds = delaySeconds; return this; } public final Map getMessageAttributes() { Map result = MessageBodyAttributeMapCopier .copyToBuilder(this.messageAttributes); if (result instanceof SdkAutoConstructMap) { return null; } return result; } public final void setMessageAttributes(Map messageAttributes) { this.messageAttributes = MessageBodyAttributeMapCopier.copyFromBuilder(messageAttributes); } @Override public final Builder messageAttributes(Map messageAttributes) { this.messageAttributes = MessageBodyAttributeMapCopier.copy(messageAttributes); return this; } public final Map getMessageSystemAttributes() { Map result = MessageBodySystemAttributeMapCopier .copyToBuilder(this.messageSystemAttributes); if (result instanceof SdkAutoConstructMap) { return null; } return result; } public final void setMessageSystemAttributes(Map messageSystemAttributes) { this.messageSystemAttributes = MessageBodySystemAttributeMapCopier.copyFromBuilder(messageSystemAttributes); } @Override public final Builder messageSystemAttributesWithStrings(Map messageSystemAttributes) { this.messageSystemAttributes = MessageBodySystemAttributeMapCopier.copy(messageSystemAttributes); return this; } @Override public final Builder messageSystemAttributes( Map messageSystemAttributes) { this.messageSystemAttributes = MessageBodySystemAttributeMapCopier.copyEnumToString(messageSystemAttributes); return this; } public final String getMessageDeduplicationId() { return messageDeduplicationId; } public final void setMessageDeduplicationId(String messageDeduplicationId) { this.messageDeduplicationId = messageDeduplicationId; } @Override public final Builder messageDeduplicationId(String messageDeduplicationId) { this.messageDeduplicationId = messageDeduplicationId; return this; } public final String getMessageGroupId() { return messageGroupId; } public final void setMessageGroupId(String messageGroupId) { this.messageGroupId = messageGroupId; } @Override public final Builder messageGroupId(String messageGroupId) { this.messageGroupId = messageGroupId; return this; } @Override public SendMessageBatchRequestEntry build() { return new SendMessageBatchRequestEntry(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy