This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 742b63ca87fd Upgrade IBM MQ to 10.0 and handle reserved JMS vendor
properties
742b63ca87fd is described below
commit 742b63ca87fdacdcc22e2c4e9b13556fe788faaf
Author: Guillaume Nodet <[email protected]>
AuthorDate: Sun Aug 2 19:10:58 2026 +0200
Upgrade IBM MQ to 10.0 and handle reserved JMS vendor properties
Upgrades IBM MQ container (9.4.5.0-r2 → 10.0.0.0-r2) and client library
(9.4.5.1 → 10.0.0.0).
IBM MQ 10.0 marks JMS_IBM_MsgToken as a reserved read-only property.
When Camel copies headers from an incoming JMS message to an outgoing
reply, JmsBinding.appendJmsProperty() now catches JMSException for
JMS vendor-specific properties (JMS_* prefix per JMS spec section 3.5.1)
and logs at WARN level, while re-throwing for non-vendor properties.
Closes #25232
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
.../apache/camel/catalog/test-infra/metadata.json | 2 +-
.../org/apache/camel/component/jms/JmsBinding.java | 21 +++++++++++++++++++--
.../component/jms/issues/JmsReplyToIbmMQTest.java | 10 +++++-----
.../ROOT/pages/camel-4x-upgrade-guide-4_22.adoc | 20 ++++++++++++++++++++
parent/pom.xml | 2 +-
.../src/generated/resources/META-INF/metadata.json | 2 +-
.../test/infra/ibmmq/services/container.properties | 2 +-
7 files changed, 48 insertions(+), 11 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
index ee07995550d3..58b30b6a1693 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
@@ -293,7 +293,7 @@
"groupId" : "org.apache.camel",
"artifactId" : "camel-test-infra-ibmmq",
"version" : "4.22.0-SNAPSHOT",
- "serviceVersion" : "9.4.5.0-r2",
+ "serviceVersion" : "10.0.0.0-r2",
"uiSupported" : true
}, {
"service" :
"org.apache.camel.test.infra.aws.common.services.AWSInfraService",
diff --git
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
index f14c46dc016e..6d211bdec594 100644
---
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
+++
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
@@ -467,8 +467,25 @@ public class JmsBinding {
if (value != null) {
// must encode to safe JMS header name before setting property
on jmsMessage
String key = jmsKeyFormatStrategy.encodeKey(headerName);
- // set the property
- JmsMessageHelper.setProperty(jmsMessage, key, value);
+ try {
+ // set the property
+ JmsMessageHelper.setProperty(jmsMessage, key, value);
+ } catch (JMSException e) {
+ // JMS vendor-specific properties (JMS_<vendor>_xxx per
JMS spec section 3.5.1)
+ // may be read-only/reserved — set by the provider, not
the application.
+ // There is no standard JMS API to query which vendor
properties are reserved,
+ // and the set can change between provider versions (e.g.
IBM MQ 10.0 made
+ // JMS_IBM_MsgToken read-only). We skip them gracefully
since they are
+ // provider-assigned metadata that should not be
propagated.
+ // For non-vendor properties, we re-throw the exception as
it likely indicates
+ // a real problem (e.g. invalid value type, message not
writable).
+ if (key.startsWith("JMS_")) {
+ LOG.warn("Could not set JMS vendor property '{}' on
outgoing message, skipping: {}",
+ key, e.getMessage());
+ } else {
+ throw e;
+ }
+ }
} else if (LOG.isDebugEnabled()) {
// okay the value is not a primitive or string so we cannot
sent it over the wire
LOG.debug("Ignoring non primitive header: {} of class: {} with
value: {}",
diff --git
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsReplyToIbmMQTest.java
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsReplyToIbmMQTest.java
index e8f246898327..fe7999fc4024 100644
---
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsReplyToIbmMQTest.java
+++
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsReplyToIbmMQTest.java
@@ -30,23 +30,23 @@ import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.extension.RegisterExtension;
import static
org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
@DisabledOnOs(architectures = { "aarch64", "aarch_64" }, disabledReason = "IBM
MQ has no Linux ARM64 native image")
-public class JmsReplyToIbmMQTest extends CamelTestSupport {
+class JmsReplyToIbmMQTest extends CamelTestSupport {
@RegisterExtension
- public static IbmMQService service = IbmMQServiceFactory.createService();
+ static IbmMQService service = IbmMQServiceFactory.createService();
@Test
- public void testCustomJMSReplyToInOut() {
+ void testCustomJMSReplyToInOut() {
JmsTestHelper.waitForJmsConsumerRoutes(context, "request");
template.sendBody("jms:queue:DEV.QUEUE.1", "What is your name?");
String reply
= consumer.receiveBody("jms:queue:DEV.QUEUE.2", 20000,
String.class);
- assertEquals("My name is Camel", reply);
+ assertThat(reply).isEqualTo("My name is Camel");
}
@Override
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
index aa4417a1e2a6..32db49b7f90c 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_22.adoc
@@ -1226,6 +1226,26 @@ New JMX attributes have been added for live call
monitoring:
A new `transitionToCloseState` JMX operation resets the circuit breaker to
CLOSED and clears
the call counters.
+=== camel-jms - IBM MQ client upgraded to 10.0
+
+The IBM MQ client library (`com.ibm.mq:com.ibm.mq.jakarta.client`) has been
upgraded from 9.4.x to 10.0.0.0,
+and the IBM MQ test container image from 9.4.x to 10.0.0.0.
+
+IBM MQ 10.0 marks the `JMS_IBM_MsgToken` vendor property as read-only. When
Camel copies headers from an
+incoming JMS message to an outgoing reply or forwarded message, this reserved
property previously caused a
+`MessageFormatException` that silently prevented the reply from being sent.
+
+=== camel-jms - vendor-specific JMS properties skipped when read-only
+
+When setting JMS properties on an outgoing message, Camel now catches
`JMSException` for JMS vendor-specific
+properties (those with a `JMS_` prefix, per JMS spec section 3.5.1) and logs a
`WARN` instead of propagating
+the exception. There is no standard JMS API to query which vendor properties
are reserved, and the set can
+change between provider versions. Non-vendor properties still throw on failure
as before.
+
+This change is necessary for IBM MQ 10.0 compatibility but applies to all JMS
providers. If you relied on
+exceptions from vendor-specific property failures propagating through
`JmsBinding.appendJmsProperty()`, be
+aware that they are now caught and logged at `WARN` level for `JMS_`-prefixed
properties only.
+
=== camel-clickhouse (new component)
A new `camel-clickhouse` producer component has been added. It integrates with
diff --git a/parent/pom.xml b/parent/pom.xml
index 5dbd1dcf5568..b13a54f52466 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -105,7 +105,7 @@
<citrus-version>5.0.0-M2</citrus-version>
<classgraph-version>4.8.186</classgraph-version>
<cloudant-version>0.10.20</cloudant-version>
-
<com-ibm-mq-jakarta-client-version>9.4.5.1</com-ibm-mq-jakarta-client-version>
+
<com-ibm-mq-jakarta-client-version>10.0.0.0</com-ibm-mq-jakarta-client-version>
<cometd-java-client-version>9.0.1</cometd-java-client-version>
<cometd-java-server-version>9.0.1</cometd-java-server-version>
<commons-beanutils-version>1.11.0</commons-beanutils-version>
diff --git
a/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
b/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
index ee07995550d3..58b30b6a1693 100644
---
a/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
+++
b/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
@@ -293,7 +293,7 @@
"groupId" : "org.apache.camel",
"artifactId" : "camel-test-infra-ibmmq",
"version" : "4.22.0-SNAPSHOT",
- "serviceVersion" : "9.4.5.0-r2",
+ "serviceVersion" : "10.0.0.0-r2",
"uiSupported" : true
}, {
"service" :
"org.apache.camel.test.infra.aws.common.services.AWSInfraService",
diff --git
a/test-infra/camel-test-infra-ibmmq/src/main/resources/org/apache/camel/test/infra/ibmmq/services/container.properties
b/test-infra/camel-test-infra-ibmmq/src/main/resources/org/apache/camel/test/infra/ibmmq/services/container.properties
index 75e85984246c..26d3b0be05ea 100644
---
a/test-infra/camel-test-infra-ibmmq/src/main/resources/org/apache/camel/test/infra/ibmmq/services/container.properties
+++
b/test-infra/camel-test-infra-ibmmq/src/main/resources/org/apache/camel/test/infra/ibmmq/services/container.properties
@@ -14,5 +14,5 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-ibm.mq.container=icr.io/ibm-messaging/mq:9.4.5.0-r2
+ibm.mq.container=icr.io/ibm-messaging/mq:10.0.0.0-r2
ibm.mq.container.version.exclude=amd64,arm64,ppc64le,s390x,x86_64