Repository navigation
chore: the JMS Kamelets take transactions, priority, expiry and an AMQP login (#3170) - #3219
Merged
Merged
Conversation
…QP login (apache#3170) The JMS sources (jms-apache-artemis-source, jms-amqp-10-source, jms-ibm-mq-source) take: - transacted: a message whose flow fails is rolled back and delivered again by the broker, which moves it to its dead letter queue (Artemis) or backout queue (IBM MQ) after a number of attempts. Today a message is removed when it is received, even when the flow then fails. - acknowledgementModeName: AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE. - concurrentConsumers: process several messages at the same time. The JMS sinks take deliveryPersistent, timeToLive, priority, and jmsMessageType (Text or Bytes). jms-amqp-10-source and jms-amqp-10-sink take username and password, which are used instead of jms.username and jms.password in remoteURI. jms-ibm-mq-source and jms-ibm-mq-sink take connectionNameList, for a multi-instance queue manager. serverName and serverPort take the place of the first address of the list. The descriptions of sslCipherSuite now say that the IBM MQ client takes the trust store and key store of the Java runtime (javax.net.ssl.*), and not camel.ssl. All the new options are optional and have no default: with them unset, the endpoint URIs are the same as before. Left out: - transacted on the sinks: it commits each message as soon as it is sent, whether or not a transacted source is in the same flow, so it changes nothing a receiver sees. - Map, Stream and Object for jmsMessageType: Map fails on a body that is not a Map, Stream is received as a stream that most receivers do not expect, and Object messages are disabled in camel-jms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davsclaus
force-pushed
the
ci-issue-3170-jms-options
branch
from
November 18, 2026 20:01
45c4bc9 to
ac0037b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3170: the JMS sources can have a message delivered again when its flow fails, and process several messages at the same time; the JMS sinks set the persistence, priority, expiry and message type of what they send;
jms-amqp-10-*take a login;jms-ibm-mq-*take a list of connections for a multi-instance queue manager, and say how TLS gets its key and trust stores.Today a source removes each message from the queue when it receives it, so a message whose flow fails is lost.
The options
All are optional, with no
default, as in #3174. When they are unset, the optional placeholders drop them, and the endpoint URIs are identical tomain's.Sources (
jms-apache-artemis-source,jms-amqp-10-source,jms-ibm-mq-source)transactedtransacted: "{{?transacted}}"JMSRedeliveredtrue), then moves it to its dead letter queue (Artemis) or the backout queue of the queue (IBM MQ).acknowledgementModeNameacknowledgementModeName: "{{?acknowledgementModeName}}"AUTO_ACKNOWLEDGE,CLIENT_ACKNOWLEDGE(redelivery without a transaction) orDUPS_OK_ACKNOWLEDGE(acknowledges in batches).concurrentConsumersconcurrentConsumers: "{{?concurrentConsumers}}"subscriptionSharedwas already added by #3179.Sinks (
jms-apache-artemis-sink,jms-amqp-10-sink,jms-ibm-mq-sink)deliveryPersistentdeliveryPersistent: "{{?deliveryPersistent}}"falsesends non-persistent messages, lost when the broker restarts.timeToLivetimeToLive: "{{?timeToLive}}"prioritypriority: "{{?priority}}"jmsMessageTypejmsMessageType: "{{?jmsMessageType}}"TextorBytes, whatever the body.Setting any of the first three makes camel-jms turn on
explicitQosEnabledon its own, so the Kamelets do not need that option.jms-amqp-10-source,jms-amqp-10-sinkusernameusername: "{{?username}}"remoteURIasjms.username.passwordpassword: "{{?password}}"(format: password, credentials descriptor)jms.passwordinremoteURI, which no longer needs to hold a secret.jms-ibm-mq-source,jms-ibm-mq-sinkconnectionNameListXMSC_WMQ_CONNECTION_NAME_LIST: "{{?connectionNameList}}", with apattern:host(port)entries separated by commas, for a multi-instance queue manager.connectionNameList: Camel binds the bean properties in name order, soXMSC_WMQ_HOST_NAMEandXMSC_WMQ_PORTare set after the list. The IBM MQ client then putsserverName(serverPort)in place of the first entry. The descriptions say this, and tell the user to setserverNameandserverPortto the first instance.serverNamestays required.sslCipherSuitealready existed. The IBM MQ client takes its trust store and key store from the Java runtime (javax.net.ssl.*). Camel'scamel.ssldoes not reach it: the connection factory takes only anSSLSocketFactoryobject, which a Kamelet cannot build. So there are no new options. The descriptions ofsslCipherSuiteand the partial pages now say how to set the stores.Descriptions: the "Good to know" paragraphs are updated:
transactedorCLIENT_ACKNOWLEDGE, andconcurrentConsumersexists.connectionNameList.Each partial page has a new example.
Left out
transactedon the sinks. A transacted sink commits each message as soon as it is sent, so the receiver sees no difference. That is also true when a transacted source is in the same flow and the flow then fails:transacted, sink →.out, then the flow fails.outtransacted: trueOn IBM MQ, the send is rolled back with the source, with or without the option. The likely cause is that
MQConnectionFactoryis aMap, so the two beans areequals(). Spring then finds the source's session bound to the transaction and sends on it. This needs both Kamelets to have the same connection settings. It is not documented.Map,StreamandObjectforjmsMessageType.Mapwith a text body fails with aNullPointerException.Streamarrives as a stream.Objectmessages are disabled in camel-jms by default (objectMessageEnabled).A Map body is already sent as a map message.
Verification
Tested with Camel JBang 4.24.0-SNAPSHOT:
apache/activemq-artemis:latest-alpine: core protocol, and AMQP 1.0 for thejms-amqp-10-*Kamelets.icr.io/ibm-messaging/mq:10.0.1.0-r1: plain, and a second container with a TLS key, whereDEV.APP.SVRCONNhasSSLCIPH(ANY_TLS12_OR_HIGHER).The queue depths come from
artemis queue statandrunmqsc DISPLAY QLOCAL CURDEPTH.mainand this branch, all six Kameletscamel get endpointURIs identicaltransacted: true, flow throwsJMSXDeliveryCount1 to 10,JMSRedeliveredtrue from the 2nd), then inDLQDLQBOTHRESH(3) BOQNAME(DEV.DEAD.LETTER.QUEUE): 3 deliveries, then on the backout queueput/passallfor the userJMSWMQ1079, and the next message on the queue waits tooBOTHRESH(0)(the default)CLIENT_ACKNOWLEDGE, flow throwsDLQCLIENT_ACKNOWLEDGEwithjms.redeliveryPolicy.maxRedeliveries=3inremoteURIkill -9, unsetDUPS_OK_ACKNOWLEDGEDUPS_OK_ACKNOWLEDGEandtransacted: trueconcurrentConsumers: 5concurrentConsumers: 5, random 0-500 ms per messageconcurrentConsumers: 2, not shared, 10 messagessubscriptionShared: trueandsubscriptionName, two separate integrations, 20 messagesconcurrentConsumers: 2, 20 messagesconcurrentConsumers: 2, 5 messagesAMQ229019 … already exists)A non-shared durable subscription is already activepriority: 1× 5, thenpriority: 9× 5, then a source startshigh1…high5(JMSPriority9) beforelow1…low5priority: 0JMSPriority0timeToLive: 3000, source started after 10 sExpiryQueueExpiryQueueJMSExpiration0,JMSPriority4,JMSDeliveryMode2deliveryPersistent: false, broker restartedjmsMessageType: Bytes, text bodybyte[]jmsMessageType: Text,byte[]bodyString(unset:byte[])username/passwordoptions, no login inremoteURIpasswordoption / no login at allfailed to authenticate using SASL: PLAIN/unauthorized-accessjms.password=wronginremoteURI+passwordoption right; andjms.username=wrong+usernamerightconnectionNameList: 127.0.0.1(1),localhost(31414)serverName: bad.invalid,serverPort: 1, list127.0.0.1(2),localhost(31414)localhost(31414)bad.invalid(1)localhost(31414),127.0.0.1(2)bad.invalid(1),127.0.0.1(2)sslCipherSuiteAMQ9639Eon the queue manager)sslCipherSuite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, no trust storePKIX path building failed-Djavax.net.ssl.trustStore=…camel.ssl.enabled/camel.ssl.trustStoreinsteadPKIX path building failedSSLCAUTH(REQUIRED), trust store onlyAMQ9637Eno certificate)-Djavax.net.ssl.keyStore=…(client cert in the queue manager's trust)camel get endpointshowed every new option on the endpoint URI when set, such asjms://queue:prio.art?…&priority=9.Build
The library copies of the six Kamelets were refreshed with
./mvnw -pl library/camel-kamelets resources:copy-resources@copy-resource-one. Then./mvnw clean verify -DskipTestsand./mvnw clean verifypassed from the root.KameletsCatalogTestneeded no change. The build regeneratedkamelets-index.json.Claude Code on behalf of Claus Ibsen
🤖 Generated with Claude Code