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

   Part of #3170: `jms-apache-artemis-source`, `jms-amqp-10-source` and 
`jms-ibm-mq-source` take a durable topic subscription and a message selector. 
Today a topic subscriber loses the messages sent while it is down.
   
   > **Depends on #3169.** This branch is built on top of #3169 (Artemis login 
and pooling), so its diff includes that commit until #3169 is merged. Review 
only the last commit, "the JMS sources take a durable subscription and a 
message selector". It will be rebased once #3169 is in.
   
   ### New options
   
   The names and wording are the same on all three Kamelets.
   
   | Option | camel-jms option | What it does |
   |---|---|---|
   | `subscriptionDurable` | `subscriptionDurable` | Keeps the topic 
subscription while the source is down, so messages sent meanwhile are received 
later. Default `false` |
   | `subscriptionShared` | `subscriptionShared` | A JMS 2.0 shared 
subscription, which several copies of the source share. Default `false` |
   | `subscriptionName` | `subscriptionName` | The name of the subscription. 
Also serves a shared subscription that is not durable, which is why it is 
preferred over `durableSubscriptionName` |
   | `selector` | `selector` | Receive only the messages that match, such as 
`priority > 5` |
   | `clientId` | `clientId` | New on Artemis and AMQP 1.0. IBM MQ already had 
it on its connection factory; only its description is rewritten |
   
   The "Good to know" paragraphs replace the sentence "the subscription is not 
durable" with the JMS rules:
   
   - A durable subscription needs `clientId`, unless it is shared.
   - Only one connection at a time may use a client ID.
   - These options are for a topic only.
   
   The partial pages have examples.
   
   With nothing set, the endpoint gets the camel-jms defaults 
(`subscriptionDurable=false&subscriptionShared=false`), and the optional 
options are left off it.
   
   ### Verification
   
   Tested with Camel JBang against Apache Artemis (core protocol and AMQP 1.0) 
and IBM MQ 10, in Docker.
   
   | Case | Artemis | AMQP 1.0 | IBM MQ |
   |---|---|---|---|
   | Durable: stop the source, send while it is down, start it again | 3 of 3 
received | 3 of 3 | 2 of 2 |
   | The same with the options unset | 0, as before | 0 | 0 |
   | Selector `priority > 5` on a queue, 2 messages at priority 3 and 2 at 
priority 7 | Only the 2 at priority 7; the others stay on the queue | Same | 
Same |
   
   Extra checks behind the description text, on Artemis and AMQP 1.0:
   
   | Case | Result |
   |---|---|
   | Durable without `clientId` | Receives nothing, and logs that a client ID 
is needed |
   | Shared durable without `clientId` | Works; two copies split the messages |
   | Two copies with the same `clientId` | The second receives nothing |
   | `subscriptionDurable` with `destinationType: queue` | Breaks the queue for 
producers, so the descriptions say "only for a topic" |
   
   `./mvnw clean install` passed twice, the first time with `-DskipTests`.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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