[ 
https://issues.apache.org/jira/browse/CAMEL-23761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115055#comment-18115055
 ] 

Guillaume Nodet commented on CAMEL-23761:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Analysis so far:

The test correctly exercises the delayed queue pattern: a queue is created with 
DELAY_SECONDS=20 via endpoint initialization, a message is sent, and the test 
verifies it takes >= 20 seconds to receive. The code in 
Sqs2Endpoint.createQueue() correctly sets the DELAY_SECONDS attribute, and 
Sqs2Producer.addDelay() correctly skips per-message delay when delayQueue=true.

The failure (actual: 2L >= 20L) indicates the queue-level 20-second delay is 
not being applied. Likely root cause: the consumer endpoint is initialized with 
defaultVisibilityTimeout=0, which calls updateQueueAttributes (setting 
VISIBILITY_TIMEOUT=0) — this may interfere with the DELAY_SECONDS attribute on 
Localstack. An alternate pattern (sending the message through the 
delay-configured endpoint directly) may avoid the issue.

A fix will be implemented and a PR opened.

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> SqsProducerDelayedQueueIT.delayedQueue is failing
> -------------------------------------------------
>
>                 Key: CAMEL-23761
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23761
>             Project: Camel
>          Issue Type: Test
>          Components: camel-aws2-sqs
>    Affects Versions: 4.20.0
>            Reporter: Aurélien Pupier
>            Assignee: Guillaume Nodet
>            Priority: Minor
>
> it is initally a test on spring boot side.
> ```
> org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
>       at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:190)
>       at 
> org.apache.camel.component.aws2.sqs.SqsDelayedQueueTest.delayedQueue(SqsDelayedQueueTest.java:69)
> ```
> I recreated the test on Camel core side on this branch 
> https://github.com/apupier/camel/tree/23761-sqsDelayedQueue and the same 
> error occurs:
> {noformat}
> [ERROR] Tests run: 1, Failures: 
> 1, Errors: 0, Skipped: 0, Time elapsed: 2.051 s <<< 
> FAILURE! -- in 
> org.apache.camel.component.aws2.sqs.integration.SqsProducerDelayedQueueIT
> [ERROR] 
> org.apache.camel.component.aws2.sqs.integration.SqsProducerDelayedQueueIT.delayedQueue
>  -- Time elapsed: 2.045 s <<< FAILURE!
> java.lang.AssertionError: 
> Expecting actual:
>   2L
> to be greater than or equal to:
>   20L
>       at 
> org.apache.camel.component.aws2.sqs.integration.SqsProducerDelayedQueueIT.delayedQueue(SqsProducerDelayedQueueIT.java:51)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to