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

   Two new Kamelets for Apache ActiveMQ Classic over OpenWire, built like the 
`jms-apache-artemis-*` pair.
   
   ## The Kamelets
   
   - `jms-apache-activemq-source`: receives each message from a queue or a 
topic.
     Options: `brokerURL` (`tcp://`, `ssl://` or `failover:(...)`), 
`destinationType` (`queue`/`topic`), `destinationName`, `username`/`password` 
(credentials), `clientId`, `subscriptionDurable`, `subscriptionName`, 
`selector`, `concurrentConsumers`, `transacted`, `acknowledgementModeName`.
     Output: text, bytes or a Map, by JMS message kind; JMS properties and JMS 
headers (`JMSMessageID`, `JMSDestination` such as `queue://orders`, 
`JMSTimestamp`, `JMSPriority`, `JMSRedelivered`) as headers.
   - `jms-apache-activemq-sink`: sends each message to a queue or a topic.
     Options: `brokerURL`, `destinationType`, `destinationName`, 
`username`/`password` (credentials), `maxSessionsPerConnection`, 
`maxIdleSessionsPerConnection`, `connectionIdleTimeout`, `deliveryPersistent`, 
`timeToLive`, `priority`, `jmsMessageType`.
     Input: text, bytes or a Map; the headers become JMS properties. 
`CamelJms*` headers are removed before sending, so a header cannot choose 
another queue. Output: the message unchanged, with 
`CamelJMSDestinationProduced`.
   
   ## How they are built
   
   - They use the generic `camel:jms` component with an 
`org.apache.activemq.ActiveMQConnectionFactory` bean, as the Artemis pair does, 
rather than `camel:activemq`/`camel:activemq6`. That keeps the options, the 
template and the description of the four Kamelets the same. It also keeps the 
connection factory to the Kamelet: the `activemq6` component takes the broker 
URL and login as component options, which a Kamelet cannot set per use without 
a bean of its own. The dependency is 
`mvn:org.apache.activemq:activemq-client:6.3.2`, the version Camel uses (the 
Artemis pair also uses Camel's Artemis version). The sink pools its connections 
with `pooled-jms`, like the Artemis sink.
   - There is no `subscriptionShared` option. ActiveMQ Classic has no shared 
subscriptions: `createSharedConsumer(...) is not supported`, checked against 
6.2.0.
   - The old Kamelets of the same names, removed for Camel 4.0, had a default 
`admin`/`admin` login and used `activemq-http`. The new ones log in only when 
`username`/`password` are set.
   - ActiveMQ-specific facts in the descriptions were checked by running the 
Kamelets: TLS with `ssl://`; `failover:` waits while no broker can be reached; 
6 redeliveries and then `ActiveMQ.DLQ` (transacted and `CLIENT_ACKNOWLEDGE`); 
an expired persistent message goes to `ActiveMQ.DLQ` and an expired 
non-persistent one is dropped; a durable subscription without `clientId` is 
refused and retried every 5 seconds; a wrong login or a broker that cannot be 
reached: the source retries every 5 seconds, and the sink fails the message.
   
   ## Tests
   
   Citrus, in `tests/camel-kamelets-itest/src/test/resources/jms/` 
(`MessagingIT#jms`), against `apache/activemq-classic:6.2.0` with a login:
   
   - `jms-apache-activemq-sink-route`: the message is unchanged after the sink, 
with `CamelJMSDestinationProduced=orders`. It reaches `queue://orders` even 
with a `CamelJmsDestinationName` header naming another queue. It is persistent 
with priority 4, and its header arrives as a JMS property. A wrong password 
fails the message (`User name [amq] or password is invalid`).
   - `jms-apache-activemq-source-route`: the source gets text, the JMS property 
and the JMS headers, and its `selector` leaves out a message that does not 
match.
   - `jms-apache-activemq-topic-route`: sink to topic to subscribed source, 
with the body, a header and `topic://prices`.
   - `jms-apache-activemq-source-transacted-route`: a failing flow gets the 
message 7 times, the last 6 with `JMSRedelivered=true`, and the broker then 
moves it to `ActiveMQ.DLQ`.
   
   Local results: `./mvnw -o clean install -DskipITs` passes (catalog 
validation, `KameletsCatalogTest` with the two new header counts). 
`MessagingIT#jms`: 10 of 10 pass, the 4 new tests and the 6 existing Artemis, 
AMQP 1.0 and IBM MQ ones. The full `MessagingIT` ran 17 tests: 14 pass, and the 
3 Pulsar tests fail because their container does not start here ("Not enough 
non-faulty bookies", the local Docker disk is almost full, with 790 MB free). 
This branch does not touch Pulsar.
   
   Fixes #3329.
   
   ## Upgrade note
   
   ```
   New Kamelets `jms-apache-activemq-source` and `jms-apache-activemq-sink` for 
Apache ActiveMQ Classic over OpenWire. They take the names of the Kamelets 
removed in 4.0, and are built like `jms-apache-artemis-*`: the `jms` component 
with the ActiveMQ 6.x client. There is no default `admin`/`admin` login any 
more, and no `subscriptionShared` option, as ActiveMQ Classic has no shared 
subscriptions.
   ```
   
   _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