aws / aws-sdk-java-v2

The official AWS SDK for Java - Version 2
Apache License 2.0
2.16k stars 840 forks source link

Bytes Based batching for SendMessageRequest Batching #5540

Closed joviegas closed 1 month ago

joviegas commented 1 month ago

Motivation and Context

Reference Doc for size of SendMessageBatch Size

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessageBatch.html

The maximum allowed individual message size and the maximum total payload size (the sum of the individual lengths of all of the batched messages) are both 256 KiB (262,144 bytes).

Reference Doc for size of message-attributes

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes In our implementation, we’ve accounted for an ATTRIBUTE_MAPS_PAYLOAD_BYTES size of 16 KB. This represents a worst-case scenario where the user sends the maximum possible attribute map in SendMessage. This consideration primarily affects batching in cases where the messages payload comes close to 240 KB. For smaller messages, this will have little to no impact on batching behavior.

Modifications

Is this config exposed to Public API

No, this is not exposed in public api we are setting a Default of 256K payload size.

Testing

Screenshots (if appropriate)

Types of changes

License

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint