Skip to content

Commit

Permalink
Support JMS ObjectMessage
Browse files Browse the repository at this point in the history
Fixes #2599
  • Loading branch information
jamesnetherton committed Jul 21, 2021
1 parent e16d416 commit 3fc57c1
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 3 deletions.
13 changes: 13 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/activemq.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ Or add the coordinates to your existing project:

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

=== Message mapping with `org.w3c.dom.Node`

The Camel ActiveMQ 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.


== Camel Quarkus limitations

ActiveMQ https://activemq.apache.org/selectors.html[XPath selectors] are disabled in native mode as the functionality depends on `activemq-broker`. This dependency
Expand Down
13 changes: 13 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/amqp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ Or add the coordinates to your existing project:

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

=== Message mapping with `org.w3c.dom.Node`

The Camel AMQP 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.


== Additional Camel Quarkus configuration

The extension leverages the https://github.com/amqphub/quarkus-qpid-jms/[Quarkus Qpid JMS] extension. A ConnectionFactory bean is automatically created
Expand Down
5 changes: 5 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/jms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.

13 changes: 13 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/sjms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ Or add the coordinates to your existing project:
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

=== Message mapping with `org.w3c.dom.Node`

The Camel SJMS 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.

13 changes: 13 additions & 0 deletions docs/modules/ROOT/pages/reference/extensions/sjms2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,16 @@ Or add the coordinates to your existing project:
----

Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.

== Usage

=== Message mapping with `org.w3c.dom.Node`

The Camel SJMS2 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.

9 changes: 9 additions & 0 deletions extensions/activemq/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=== Message mapping with `org.w3c.dom.Node`

The Camel ActiveMQ 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.
9 changes: 9 additions & 0 deletions extensions/amqp/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=== Message mapping with `org.w3c.dom.Node`

The Camel AMQP 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelSerializationBuildItem;

class JmsProcessor {

Expand All @@ -28,4 +29,8 @@ FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
CamelSerializationBuildItem serialization() {
return new CamelSerializationBuildItem();
}
}
5 changes: 5 additions & 0 deletions extensions/jms/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelSerializationBuildItem;

public class CamelSjmsProcessor {
private static final String FEATURE = "camel-sjms";
Expand All @@ -26,4 +27,9 @@ public class CamelSjmsProcessor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
CamelSerializationBuildItem serialization() {
return new CamelSerializationBuildItem();
}
}
9 changes: 9 additions & 0 deletions extensions/sjms/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=== Message mapping with `org.w3c.dom.Node`

The Camel SJMS 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import org.apache.camel.quarkus.core.deployment.spi.CamelSerializationBuildItem;

public class CamelSjms2Processor {
private static final String FEATURE = "camel-sjms2";
Expand All @@ -26,4 +27,9 @@ public class CamelSjms2Processor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
CamelSerializationBuildItem serialization() {
return new CamelSerializationBuildItem();
}
}
9 changes: 9 additions & 0 deletions extensions/sjms2/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
=== Message mapping with `org.w3c.dom.Node`

The Camel SJMS2 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-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 xref:user-guide/native-mode.adoc#serialization[native mode user guide] for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

import java.io.Serializable;

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection(serialization = true)
public class Person implements Serializable {
String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.common.ResourceArg;
import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
Expand Down Expand Up @@ -152,7 +151,6 @@ public void testJmsSelector() {
}

@Test
@DisabledOnNativeImage("https://github.com/apache/camel-quarkus/issues/2599")
public void testJmsObject() {
String message = "Mr Test Person";
RestAssured.given()
Expand All @@ -164,7 +162,6 @@ public void testJmsObject() {
}

@Test
@DisabledOnNativeImage("https://github.com/apache/camel-quarkus/issues/2599")
public void testJmsTransferExchange() {
String message = "Test transfer message";
RestAssured.given()
Expand Down

0 comments on commit 3fc57c1

Please sign in to comment.