This is an automated email from the ASF dual-hosted git repository.
davsclaus 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 2ce75e8f6ddd docs(jms): update JMS API references to Jakarta and fix
stale content
2ce75e8f6ddd is described below
commit 2ce75e8f6ddd39efc0dc2cc8a6eac074286ec971
Author: Stanislav Deviatov <[email protected]>
AuthorDate: Tue Aug 4 13:44:33 2026 +0200
docs(jms): update JMS API references to Jakarta and fix stale content
Rename 22 javax.jms references to jakarta.jms in jms-component.adoc and
1 in camelcontext.adoc to match the actual Jakarta Messaging API used
since Camel 4. Fix typo preserveMessageQuo -> preserveMessageQos, update
stale "Spring 2's JmsTemplate" reference, and add missing StreamMessage
rows to the type-mapping tables.
Closes #25321
Co-authored-by: Claude Opus 5 <[email protected]>
---
.../apache/camel/catalog/docs/jms-component.adoc | 65 +++++++++++++---------
.../camel-jms/src/main/docs/jms-component.adoc | 65 +++++++++++++---------
.../modules/ROOT/pages/camelcontext.adoc | 2 +-
3 files changed, 79 insertions(+), 53 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
index d71534a72193..e66743f2f002 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/jms-component.adoc
@@ -95,7 +95,7 @@ You append query options to the URI by using the following
format,
=== Using ActiveMQ
-The JMS component reuses Spring 2's `JmsTemplate` for sending messages.
+The JMS component reuses Spring's `JmsTemplate` for sending messages.
This is not ideal for use in a non-J2EE container and typically requires
some caching in the JMS provider to avoid
http://activemq.apache.org/jmstemplate-gotchas.html[poor performance].
@@ -359,7 +359,7 @@ Channel], using a JMS queue as the Dead Letter Queue, then
normally the
caused Exception is not stored in the JMS message. You can, however, use
the `transferExchange` option on the JMS dead letter queue to instruct
Camel to store the entire Exchange in the queue as a
-`javax.jms.ObjectMessage` that holds a
+`jakarta.jms.ObjectMessage` that holds a
`org.apache.camel.support.DefaultExchangeHolder`. This allows you to
consume from the Dead Letter Queue and retrieve the caused exception
from the Exchange property with the key `Exchange.EXCEPTION_CAUGHT`. The
@@ -444,7 +444,7 @@ a custom processor.
=== Message Mapping between JMS and Camel
-Camel automatically maps messages between `javax.jms.Message` and
+Camel automatically maps messages between `jakarta.jms.Message` and
`org.apache.camel.Message`.
When sending a JMS message, Camel converts the message body to the
@@ -453,36 +453,49 @@ following JMS message types:
[width="100%",cols="10%,10%,80%",options="header",]
|=======================================================================
|Body Type |JMS Message |Comment
-|`String` |`javax.jms.TextMessage` |
+|`String` |`jakarta.jms.TextMessage` |
-|`org.w3c.dom.Node` |`javax.jms.TextMessage` |The DOM will be converted
+|`org.w3c.dom.Node` |`jakarta.jms.TextMessage` |The DOM will be converted
to `String`.
-|`Map` |`javax.jms.MapMessage` |
+|`Map` |`jakarta.jms.MapMessage` |
-|`java.io.Serializable` |`javax.jms.ObjectMessage` |
+|`java.io.Serializable` |`jakarta.jms.ObjectMessage` |
-|`byte[]` |`javax.jms.BytesMessage` |
+|`byte[]` |`jakarta.jms.BytesMessage` |
-|`java.io.File` |`javax.jms.BytesMessage` |
+|`java.io.File` |`jakarta.jms.BytesMessage` |
-|`java.io.Reader` |`javax.jms.BytesMessage` |
+|`java.io.Reader` |`jakarta.jms.BytesMessage` |
-|`java.io.InputStream` |`javax.jms.BytesMessage` |
+|`java.io.InputStream` |`jakarta.jms.BytesMessage` |
-|`java.nio.ByteBuffer` |`javax.jms.BytesMessage` |
+|`org.apache.camel.WrappedFile` |`jakarta.jms.BytesMessage` |
+
+|`org.apache.camel.StreamCache` |`jakarta.jms.BytesMessage` |
+
+|`java.nio.ByteBuffer` |`jakarta.jms.BytesMessage` |
|=======================================================================
+NOTE: When the `streamMessageTypeEnabled` option is enabled, bodies of type
+`java.io.File`, `java.io.Reader`, `java.io.InputStream`,
+`org.apache.camel.WrappedFile` and `org.apache.camel.StreamCache` are sent as
+`jakarta.jms.StreamMessage` instead of `jakarta.jms.BytesMessage`. When
+`artemisStreamingEnabled` is in effect, Camel enforces
+`jakarta.jms.BytesMessage` even then, because ActiveMQ Artemis has an
+optimised streaming mode that requires bytes messages.
+
When receiving a JMS message, Camel converts the JMS message to the
following body type:
[width="100%",cols="50%,50%",options="header",]
|=============================================
|JMS Message |Body Type
-|`javax.jms.TextMessage` |`String`
-|`javax.jms.BytesMessage` |`byte[]`
-|`javax.jms.MapMessage` |`Map<String, Object>`
-|`javax.jms.ObjectMessage` |`Object`
+|`jakarta.jms.TextMessage` |`String`
+|`jakarta.jms.BytesMessage` |`byte[]`
+|`jakarta.jms.MapMessage` |`Map<String, Object>`
+|`jakarta.jms.ObjectMessage` |`Object`
+|`jakarta.jms.StreamMessage` |`java.io.InputStream`
|=============================================
=== Disabling auto-mapping of JMS messages
@@ -491,7 +504,7 @@ You can use the `mapJmsMessage` option to disable the
auto-mapping
above. If disabled, Camel will not try to map the received JMS message,
but instead uses it directly as the payload. This allows you to avoid
the overhead of mapping and let Camel just pass through the JMS message.
-For instance, it even allows you to route `javax.jms.ObjectMessage` JMS
+For instance, it even allows you to route `jakarta.jms.ObjectMessage` JMS
messages with classes you do *not* have on the classpath.
=== Using a custom MessageConverter
@@ -546,7 +559,7 @@ You can use the `jmsMessageType` option on the endpoint URL
to force a
specific message type for all messages.
In the route below, we poll files from a folder and send them as
-`javax.jms.TextMessage` as we have forced the JMS producer endpoint to
+`jakarta.jms.TextMessage` as we have forced the JMS producer endpoint to
use text messages:
[tabs]
@@ -640,7 +653,7 @@ message:
[width="100%",cols="10%,10%,80%",options="header",]
|=======================================================================
|Property |Type |Description
-|`org.apache.camel.jms.replyDestination` |`javax.jms.Destination` |The
+|`org.apache.camel.jms.replyDestination` |`jakarta.jms.Destination` |The
reply destination.
|=======================================================================
@@ -654,7 +667,7 @@ it receives a JMS message:
|`JMSDeliveryMode` |`int` |The JMS delivery mode.
-|`JMSDestination` |`javax.jms.Destination` |The JMS destination.
+|`JMSDestination` |`jakarta.jms.Destination` |The JMS destination.
|`JMSExpiration` |`long` |The JMS expiration.
@@ -665,7 +678,7 @@ and 9 as the highest).
|`JMSRedelivered` |`boolean` |Whether the JMS message is redelivered.
-|`JMSReplyTo` |`javax.jms.Destination` |The JMS reply-to destination.
+|`JMSReplyTo` |`jakarta.jms.Destination` |The JMS reply-to destination.
|`JMSTimestamp` |`long` |The JMS timestamp.
@@ -716,9 +729,9 @@ the specified `JMSReplyTo` queue.
|_InOnly_ |`JMSReplyTo` is set |By default, Camel discards the
`JMSReplyTo` destination and clears the `JMSReplyTo` header before
sending the message. Camel then sends the message and does *not* expect
-a reply. Camel logs this in the log at `WARN` level (changed to `DEBUG`
-level from *Camel 2.6* onwards. You can use `preserveMessageQuo=true` to
-instruct Camel to keep the `JMSReplyTo`. In all situations the
+a reply. Camel logs this in the log at `DEBUG` level. You can use
+`preserveMessageQos=true` to instruct Camel to keep the `JMSReplyTo`.
+In all situations the
`JmsProducer` does *not* expect any reply and thus continue after
sending the message.
|=======================================================================
@@ -799,7 +812,7 @@ You can specify the destination in the following headers:
[width="100%",cols="10%,10%,80%",options="header",]
|=====================================================================
|Header |Type |Description
-|`CamelJmsDestination` |`javax.jms.Destination` |A destination object.
+|`CamelJmsDestination` |`jakarta.jms.Destination` |A destination object.
|`CamelJmsDestinationName` |`String` |The destination name.
|=====================================================================
@@ -1385,7 +1398,7 @@
http://forum.springsource.org/showthread.php?123631-JMS-DMLC-not-caching%20conne
=== Using JMSReplyTo for late replies
When using Camel as a JMS listener, it sets an Exchange property with
-the value of the ReplyTo `javax.jms.Destination` object, having the key
+the value of the ReplyTo `jakarta.jms.Destination` object, having the key
`ReplyTo`. You can obtain this `Destination` as follows:
._Java-only: uses JMS `Destination` object and Camel Java API_
diff --git a/components/camel-jms/src/main/docs/jms-component.adoc
b/components/camel-jms/src/main/docs/jms-component.adoc
index d71534a72193..e66743f2f002 100644
--- a/components/camel-jms/src/main/docs/jms-component.adoc
+++ b/components/camel-jms/src/main/docs/jms-component.adoc
@@ -95,7 +95,7 @@ You append query options to the URI by using the following
format,
=== Using ActiveMQ
-The JMS component reuses Spring 2's `JmsTemplate` for sending messages.
+The JMS component reuses Spring's `JmsTemplate` for sending messages.
This is not ideal for use in a non-J2EE container and typically requires
some caching in the JMS provider to avoid
http://activemq.apache.org/jmstemplate-gotchas.html[poor performance].
@@ -359,7 +359,7 @@ Channel], using a JMS queue as the Dead Letter Queue, then
normally the
caused Exception is not stored in the JMS message. You can, however, use
the `transferExchange` option on the JMS dead letter queue to instruct
Camel to store the entire Exchange in the queue as a
-`javax.jms.ObjectMessage` that holds a
+`jakarta.jms.ObjectMessage` that holds a
`org.apache.camel.support.DefaultExchangeHolder`. This allows you to
consume from the Dead Letter Queue and retrieve the caused exception
from the Exchange property with the key `Exchange.EXCEPTION_CAUGHT`. The
@@ -444,7 +444,7 @@ a custom processor.
=== Message Mapping between JMS and Camel
-Camel automatically maps messages between `javax.jms.Message` and
+Camel automatically maps messages between `jakarta.jms.Message` and
`org.apache.camel.Message`.
When sending a JMS message, Camel converts the message body to the
@@ -453,36 +453,49 @@ following JMS message types:
[width="100%",cols="10%,10%,80%",options="header",]
|=======================================================================
|Body Type |JMS Message |Comment
-|`String` |`javax.jms.TextMessage` |
+|`String` |`jakarta.jms.TextMessage` |
-|`org.w3c.dom.Node` |`javax.jms.TextMessage` |The DOM will be converted
+|`org.w3c.dom.Node` |`jakarta.jms.TextMessage` |The DOM will be converted
to `String`.
-|`Map` |`javax.jms.MapMessage` |
+|`Map` |`jakarta.jms.MapMessage` |
-|`java.io.Serializable` |`javax.jms.ObjectMessage` |
+|`java.io.Serializable` |`jakarta.jms.ObjectMessage` |
-|`byte[]` |`javax.jms.BytesMessage` |
+|`byte[]` |`jakarta.jms.BytesMessage` |
-|`java.io.File` |`javax.jms.BytesMessage` |
+|`java.io.File` |`jakarta.jms.BytesMessage` |
-|`java.io.Reader` |`javax.jms.BytesMessage` |
+|`java.io.Reader` |`jakarta.jms.BytesMessage` |
-|`java.io.InputStream` |`javax.jms.BytesMessage` |
+|`java.io.InputStream` |`jakarta.jms.BytesMessage` |
-|`java.nio.ByteBuffer` |`javax.jms.BytesMessage` |
+|`org.apache.camel.WrappedFile` |`jakarta.jms.BytesMessage` |
+
+|`org.apache.camel.StreamCache` |`jakarta.jms.BytesMessage` |
+
+|`java.nio.ByteBuffer` |`jakarta.jms.BytesMessage` |
|=======================================================================
+NOTE: When the `streamMessageTypeEnabled` option is enabled, bodies of type
+`java.io.File`, `java.io.Reader`, `java.io.InputStream`,
+`org.apache.camel.WrappedFile` and `org.apache.camel.StreamCache` are sent as
+`jakarta.jms.StreamMessage` instead of `jakarta.jms.BytesMessage`. When
+`artemisStreamingEnabled` is in effect, Camel enforces
+`jakarta.jms.BytesMessage` even then, because ActiveMQ Artemis has an
+optimised streaming mode that requires bytes messages.
+
When receiving a JMS message, Camel converts the JMS message to the
following body type:
[width="100%",cols="50%,50%",options="header",]
|=============================================
|JMS Message |Body Type
-|`javax.jms.TextMessage` |`String`
-|`javax.jms.BytesMessage` |`byte[]`
-|`javax.jms.MapMessage` |`Map<String, Object>`
-|`javax.jms.ObjectMessage` |`Object`
+|`jakarta.jms.TextMessage` |`String`
+|`jakarta.jms.BytesMessage` |`byte[]`
+|`jakarta.jms.MapMessage` |`Map<String, Object>`
+|`jakarta.jms.ObjectMessage` |`Object`
+|`jakarta.jms.StreamMessage` |`java.io.InputStream`
|=============================================
=== Disabling auto-mapping of JMS messages
@@ -491,7 +504,7 @@ You can use the `mapJmsMessage` option to disable the
auto-mapping
above. If disabled, Camel will not try to map the received JMS message,
but instead uses it directly as the payload. This allows you to avoid
the overhead of mapping and let Camel just pass through the JMS message.
-For instance, it even allows you to route `javax.jms.ObjectMessage` JMS
+For instance, it even allows you to route `jakarta.jms.ObjectMessage` JMS
messages with classes you do *not* have on the classpath.
=== Using a custom MessageConverter
@@ -546,7 +559,7 @@ You can use the `jmsMessageType` option on the endpoint URL
to force a
specific message type for all messages.
In the route below, we poll files from a folder and send them as
-`javax.jms.TextMessage` as we have forced the JMS producer endpoint to
+`jakarta.jms.TextMessage` as we have forced the JMS producer endpoint to
use text messages:
[tabs]
@@ -640,7 +653,7 @@ message:
[width="100%",cols="10%,10%,80%",options="header",]
|=======================================================================
|Property |Type |Description
-|`org.apache.camel.jms.replyDestination` |`javax.jms.Destination` |The
+|`org.apache.camel.jms.replyDestination` |`jakarta.jms.Destination` |The
reply destination.
|=======================================================================
@@ -654,7 +667,7 @@ it receives a JMS message:
|`JMSDeliveryMode` |`int` |The JMS delivery mode.
-|`JMSDestination` |`javax.jms.Destination` |The JMS destination.
+|`JMSDestination` |`jakarta.jms.Destination` |The JMS destination.
|`JMSExpiration` |`long` |The JMS expiration.
@@ -665,7 +678,7 @@ and 9 as the highest).
|`JMSRedelivered` |`boolean` |Whether the JMS message is redelivered.
-|`JMSReplyTo` |`javax.jms.Destination` |The JMS reply-to destination.
+|`JMSReplyTo` |`jakarta.jms.Destination` |The JMS reply-to destination.
|`JMSTimestamp` |`long` |The JMS timestamp.
@@ -716,9 +729,9 @@ the specified `JMSReplyTo` queue.
|_InOnly_ |`JMSReplyTo` is set |By default, Camel discards the
`JMSReplyTo` destination and clears the `JMSReplyTo` header before
sending the message. Camel then sends the message and does *not* expect
-a reply. Camel logs this in the log at `WARN` level (changed to `DEBUG`
-level from *Camel 2.6* onwards. You can use `preserveMessageQuo=true` to
-instruct Camel to keep the `JMSReplyTo`. In all situations the
+a reply. Camel logs this in the log at `DEBUG` level. You can use
+`preserveMessageQos=true` to instruct Camel to keep the `JMSReplyTo`.
+In all situations the
`JmsProducer` does *not* expect any reply and thus continue after
sending the message.
|=======================================================================
@@ -799,7 +812,7 @@ You can specify the destination in the following headers:
[width="100%",cols="10%,10%,80%",options="header",]
|=====================================================================
|Header |Type |Description
-|`CamelJmsDestination` |`javax.jms.Destination` |A destination object.
+|`CamelJmsDestination` |`jakarta.jms.Destination` |A destination object.
|`CamelJmsDestinationName` |`String` |The destination name.
|=====================================================================
@@ -1385,7 +1398,7 @@
http://forum.springsource.org/showthread.php?123631-JMS-DMLC-not-caching%20conne
=== Using JMSReplyTo for late replies
When using Camel as a JMS listener, it sets an Exchange property with
-the value of the ReplyTo `javax.jms.Destination` object, having the key
+the value of the ReplyTo `jakarta.jms.Destination` object, having the key
`ReplyTo`. You can obtain this `Destination` as follows:
._Java-only: uses JMS `Destination` object and Camel Java API_
diff --git a/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
b/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
index 01bdd29b197e..0fd3a5b880e4 100644
--- a/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camelcontext.adoc
@@ -198,7 +198,7 @@ A producer is the Camel abstraction that refers to an
entity capable of sending
an endpoint. When a message is sent to an endpoint, the producer handles the
details of getting
the message data compatible with that particular endpoint. For example,
`FileProducer`
will write the message body to a `java.io.File`. `JmsProducer`, on the other
hand, will map
-the Camel message to `javax.jms.Message` before sending it to a JMS
destination. This
+the Camel message to `jakarta.jms.Message` before sending it to a JMS
destination. This
is an important feature in Camel, because it hides the complexity of
interacting with
particular transports. All you need to do is route a message to an endpoint,
and the producer
does the heavy lifting.