Claus Ibsen created CAMEL-27874:
-----------------------------------
Summary: camel-aws2-sqs: queue attributes sent without a queue
URL, sortAttributeName compares numbers as text, batch request bodies skip the
options
Key: CAMEL-27874
URL: https://issues.apache.org/jira/browse/CAMEL-27874
Project: Camel
Issue Type: Bug
Components: camel-aws2-sqs
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-aws2-sqs for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31149).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. Queue attributes are sent without a queue URL
{{Sqs2Endpoint.doInit}}: when the queue is not found and autoCreateQueue=false,
updateQueueAttributes() still runs with queueUrl == null; with any queue option
set (defaultVisibilityTimeout, policy, redrivePolicy, ...) SetQueueAttributes
fails with an SDK validation error instead of a "queue does not exist" error.
Proposed change: skip updateQueueAttributes without a queue URL, or fail with a
clear message.
h4. 2. autoCreateQueue does not create the queue at start with queueUrl
When queueUrl is set, or region and queueOwnerAWSAccountId, doInit never
creates the queue with autoCreateQueue=true and sets the attributes on a queue
that may not exist; only the consumer creates it later on QueueDoesNotExist.
Proposed change: check the existence when autoCreateQueue=true, or document it.
h4. 3. The attribute limit also counts headers that cannot be sent
{{Sqs2Producer.translateAttributes}} applies the 10-attribute limit action also
to headers whose value cannot be converted (Map, List), so FAIL throws for a
header that would be dropped anyway.
Proposed change: convert first, and apply the limit to convertible values only.
h4. 4. sortAttributeName compares numbers as text
{{Sqs2Consumer.PollingTask.sortIfNeeded}} compares the attribute values as
strings, so ApproximateReceiveCount "10" sorts before "2", and a message
without the attribute sorts first.
Proposed change: compare numerically when both values are numbers.
h4. 5. A SendMessageBatchRequest body skips the endpoint options
{{Sqs2Producer.sendBatchMessage}} sends a SendMessageBatchRequest body as is:
no queueUrl is filled in, it is not split into requests of 10, and the FIFO and
delay options are not applied. This is not documented.
Proposed change: fill in the queue URL, or document it.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)