JMS
JVM since1.0.0 Native since1.0.0
Sent and receive messages to/from a JMS Queue or Topic.
What’s inside
-
JMS component, URI syntax:
jms:destinationType:destinationName
Please refer to the above link for usage and configuration details.
Maven coordinates
Or add the coordinates to your existing project:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-jms</artifactId>
</dependency>
Check the User guide for more information about writing Camel Quarkus applications.
Usage
Message mapping with org.w3c.dom.Node
The Camel JMS component supports message mapping between javax.jms.Message
and org.apache.camel.Message
. When wanting to convert a Camel message body type of org.w3c.dom.Node
, you must ensure that the camel-quarkus-xml-jaxp
extension is present on the classpath.
Native mode support for javax.jms.ObjectMessage
When sending JMS message payloads as javax.jms.ObjectMessage
, you must annotate the relevant classes to be registered for serialization with @RegisterForReflection(serialization = true)
. Note that this extension automatically sets quarkus.camel.native.reflection.serialization-enabled = true
for you. Refer to the native mode user guide for more information.
Support for Connection pooling and X/Open XA distributed transactions
You can use the quarkus-pooled-jms
extension to get pooling and XA support for JMS connections. Refer to the quarkus-pooled-jms extension documentation for more information. Currently, it only works with quarkus-artemis-jms
extension. Just add these two dependencies to your pom.xml
:
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.artemis</groupId>
<artifactId>quarkus-artemis-jms</artifactId>
</dependency>
Note that pooling is enabled by default.
To enable XA, you need to add the following configuration to your application.properties
:
quarkus.pooled-jms.xa.enabled=true
|
transferException option in native mode
To use the transferException
option in native mode, you must enable support for object serialization. Refer to the native mode user guide for more information.
You will also need to enable serialization for the exception classes that you intend to serialize. For example.
@RegisterForReflection(targets = { IllegalStateException.class, MyCustomException.class }, serialization = true)