Federico Mariani created CAMEL-27473:
----------------------------------------
Summary: camel-aws2-sqs - extendMessageVisibility: the visibility
is no longer extended after one failure that is not an SdkException
Key: CAMEL-27473
URL: https://issues.apache.org/jira/browse/CAMEL-27473
Project: Camel
Issue Type: Sub-task
Components: camel-aws2-sqs
Reporter: Federico Mariani
With {{extendMessageVisibility=true}}, {{Sqs2Consumer}} extends the visibility
of the messages in flight from a {{TimeoutExtender}} task
({{scheduleAtFixedRate}}), whose {{run()}} catches only {{SdkException}}. Any
other {{RuntimeException}} (such as one of an {{ExecutionInterceptor}} of the
client), or an Error, ends the task for good. The visibility of the messages in
flight, and of all the messages the consumer receives after that, is no longer
extended, so SQS makes them visible again and delivers them a second time while
the route still processes them. Nothing is logged.
Reproduced on main with an {{AmazonSQSClientMock}} whose first
{{changeMessageVisibilityBatch}} throws an {{IllegalStateException}},
{{visibilityTimeout=2}}, and a route that holds the message for 6 seconds:
{noformat}
changeMessageVisibilityBatch calls in 6 seconds: 1 (the extender runs every
second)
{noformat}
Suggested fix: catch {{Exception}}, and an Error that is not a
{{VirtualMachineError}}, inside {{run()}}, log it, and go on at the next run.
_Claude Code on behalf of Croway_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)