davsclaus opened a new pull request, #3353:
URL: https://github.com/apache/camel-kamelets/pull/3353

   Follows two camel-aws2-eventbridge fixes merged on Camel main for 4.24.0:
   
   - [CAMEL-27360](https://issues.apache.org/jira/browse/CAMEL-27360): when 
there is no `queueUrl`, the consumer calls `DescribeRule` before it creates the 
queue. The queue policy only accepts the events of that rule (an 
`aws:SourceArn` condition).
   - [CAMEL-27378](https://issues.apache.org/jira/browse/CAMEL-27378): with 
`deleteQueueOnShutdown=false`, the auto-created queue has a stable name, 
`camel-eventbridge-<rule>-<hash>`. The next start reuses it, and it stays a 
target of the rule.
   
   ## Changes to aws-eventbridge-source
   
   - "Good to know":
     - The IAM list adds `events:DescribeRule` on the rule, needed without 
`queueURL`.
     - A missing rule fails the start, and no queue is created. Before, the 
queue was created and then deleted.
     - The queue that the Kamelet creates lets only its rule send events to it.
   - New option `deleteQueueOnShutdown`, boolean, default `true`. The template 
passes `{{deleteQueueOnShutdown}}`, so the default is unchanged. "Good to know" 
describes both modes:
     - **Default:** the queue name has a random part. On stop, the queue is 
removed from the rule and deleted, so the events of the stopped time are lost, 
and each replica gets its own queue.
     - **`false`:** the queue name is made from the event bus and the rule 
name, and the queue stays a target of the rule. It collects the events while 
the Kamelet does not run, the next start reuses it, and the replicas share it. 
Delete it yourself once it is no longer used.
   - The `queueURL` description points to the new option.
   
   ## Tests
   
   Local `AwsIT#awsEventBridge` with Floci: **3 tests, 3 passed**. Floci 
supports `DescribeRule`. I checked it by hand too: it returns the rule ARN, and 
`ResourceNotFoundException` for a missing rule.
   
   - `aws-eventbridge-source-test`: new `verifyQueuePolicy.groovy`. It checks 
that the policy of the one queue created for the rule has 
`"aws:SourceArn":"<rule ARN>"`.
   - New `aws-eventbridge-source-keep-test` with `deleteQueueOnShutdown: false`:
     1. A first run creates the queue and is stopped.
     2. The test checks that there is exactly one queue for the rule and that 
it is still the rule's only target, then puts an event on the bus.
     3. A second run gets that event. The header `X-Run: second` shows it was 
not the first run while it stopped.
     4. The test checks that the queue URL is the same as after the first run.
   
   Checked by hand with `camel run` against Floci: a missing rule fails the 
start with `Failed to start route ... because: Rule not found: nosuch-rule 
(Service: EventBridge, Status Code: 400 ...)`. `ListQueues` is empty afterwards.
   
   ## Upgrade note
   
   ```
   * `aws-eventbridge-source` without `queueURL` now needs 
`events:DescribeRule` on the rule; the queue it creates only accepts the events 
of its rule, and a missing rule fails the start before a queue is created. New 
option `deleteQueueOnShutdown` (default `true`): with `false` the queue keeps a 
fixed name and its rule target, collects the events while the Kamelet does not 
run, and is reused at the next start.
   ```
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
   


-- 
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]

Reply via email to