-
Notifications
You must be signed in to change notification settings - Fork 942
Description
Describe the bug
In SQS, ReceiveMessageRequest.builder().attributeNames() Enum values does not correspond the the message attributes
- All
- ApproximateFirstReceiveTimestamp
- ApproximateReceiveCount
- AWSTraceHeader
- SenderId
- SentTimestamp
- MessageDeduplicationId
- MessageGroupId
- SequenceNumber
Right now the method accepts the QueueAttributeName enum that does not contains those values.
Expected Behavior
When trying to receive message with some specific attributes I should be able to specify them using the correct Enum.
Current Behavior
The method attributeNames() should use an Enum with message attributes values (ex: MessageAttributeNames)
Steps to Reproduce
For example, now since the attributeNames is scoped to the wrong enum, we cant get a property like ApproximateReceiveCount
final ReceiveMessageRequest receiveMessageRequest = ReceiveMessageRequest.builder()
.queueUrl(queueUrl)
// I cant call an enum with the ApproximateReceiveCount
.attributeNames(QueueAttributeName.???)
// However this works
.attributeNamesWithStrings("ApproximateReceiveCount")
.maxNumberOfMessages(10)
.waitTimeSeconds(seconds)
.build();
As you can see .attributeNamesWithStrings("ApproximateReceiveCount")
does behave correctly but It is impossible to do the same with the Enum version .attributeNames(???)
.
Possible Solution
Implement a new enum (ex: MessageAttributeNames)
that coincide with the following properties
- All
- ApproximateFirstReceiveTimestamp
- ApproximateReceiveCountAWSTraceHeader
- SenderId
- SentTimestamp
- MessageDeduplicationId
- MessageGroupId
- SequenceNumber
Context
Your Environment
- AWS Java SDK version used: 2.17.1
- JDK version used: openjdk 11
- Operating System and version: Linux with Ubuntu 20.04 LTS