gnodet opened a new pull request, #1976:
URL: https://github.com/apache/camel-spring-boot/pull/1976
## Summary
Fixes `BaseSqs.receiveMessageFromQueue` to use `visibilityTimeout=0` instead
of `defaultVisibilityTimeout=0`, correcting the root cause of
`SqsDelayedQueueTest.delayedQueue()` failing.
## Root Cause
`BaseSqs.receiveMessageFromQueue` built its consumer endpoint URI with
`defaultVisibilityTimeout=0`. This parameter maps to the queue-level
`VISIBILITY_TIMEOUT` attribute in AWS SQS, causing Camel to call
`SetQueueAttributes({VISIBILITY_TIMEOUT: 0})` when the endpoint initializes.
On LocalStack, `SetQueueAttributes` with `VISIBILITY_TIMEOUT=0`
inadvertently resets `DELAY_SECONDS` to 0 as well, overwriting the 20-second
delay set during queue creation. The message therefore becomes available
immediately, and the `Duration.between(start, now).getSeconds() >= delay`
assertion fails.
The two parameters are distinct:
- `defaultVisibilityTimeout` → `SetQueueAttributes(VISIBILITY_TIMEOUT)` —
queue-level attribute, called during endpoint initialization, can overwrite
other queue attributes on LocalStack
- `visibilityTimeout` → `ReceiveMessage(VisibilityTimeout)` — per-request
timeout, does **not** call `SetQueueAttributes`, does not affect `DELAY_SECONDS`
## Fix
Replace `defaultVisibilityTimeout=0` with `visibilityTimeout=0` in
`BaseSqs.receiveMessageFromQueue`. The per-request timeout achieves the same
intent (messages re-become visible immediately for the next poll) without
modifying the queue's `DELAY_SECONDS` attribute.
## Notes
- `SqsDelayedQueueTest` is still annotated `@DisabledIfSystemProperty(named
= "ci.env.name", matches = "github.com")` since Docker is not available in the
GitHub Actions environment. That annotation is unchanged — this PR fixes only
the correctness of the test helper.
- The companion fix in `apache/camel` (adding the test there with the
correct parameter from the start): https://github.com/apache/camel/pull/26395
## References
- JIRA: https://issues.apache.org/jira/browse/CAMEL-23761
- camel PR: https://github.com/apache/camel/pull/26395
---
_Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]