Details
Description
Currently SqsConsumer will scheduled a future to happen start occruing 1/2 the visibility timeout, and reoccur again at the visibility timeout period. Because of the way SQS works, when you request a ChangeMessageVisibility timeout it does not add that to the time remaining on the message visibility. Instead it will set the message visibility to the time out given. This means that what actually happens in the camel code is that:
- we request the ChangeMessageVisibility timeout to be set to X seconds from now after X/2 seconds
- then every X seconds after that we we request the ChangeMessageVisibility timeout to be set to X from now
This means that our message will become visible every now and again as the ChangeMessageVisibility timeout is not updated in time as period between successive executions is the same as the timeout period we request.
I've attached two patches which would fix this issue.
- "aws_sqs_visibility_timeout_simple.patch" - This patch changes the way we set up the future. The delay and period are now the same so that we call ChangeMessageVisibility every X/2 after the message has been pulled.
- "aws_sqs_visibility_timeout_phased_timeout.patch" - This one keeps the delay to 1/2 the period and requests ChangeMessageVisibility every period. This time though it requests the visibility to be 1.5 * the period. This means that it behaves as originally planned, as if it was adding duration to the visibility duration left. This means we call Amazon less times and still keep the message hidden as expected.
This was looked at with Alex Hutter (both working on same project).
Attachments
Attachments
Issue Links
- is related to
-
CAMEL-5944 Setting extendMessageVisibility on an SQS consumer doesn't make visibilityTimeout compulsory
- Resolved
- relates to
-
CAMEL-5306 Support for sending ChangeMessageVisibility calls while processing SQS messages
- Resolved