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 20, 2021
1 parent e16d416 commit 0a2065d
Show file tree
Hide file tree
Showing 16 changed files with 192 additions and 3 deletions.
21 changes: 21 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,27 @@ 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 features requiring object serialization

Support for features requiring object serialization such as the `transferExchange` option and `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.


== 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
21 changes: 21 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,27 @@ 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 features requiring object serialization

Support for features requiring object serialization such as the `transferExchange` option and `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.


== 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
13 changes: 13 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,16 @@ 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 features requiring object serialization

Support for features requiring object serialization such as the `transferExchange` option and `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.

16 changes: 16 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,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

=== Native mode support for features requiring object serialization

Support for features requiring object serialization such as `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.

16 changes: 16 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,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

=== Native mode support for features requiring object serialization

Support for features requiring object serialization such as `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.

17 changes: 17 additions & 0 deletions extensions/activemq/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=== 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 features requiring object serialization

Support for features requiring object serialization such as the `transferExchange` option and `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.
17 changes: 17 additions & 0 deletions extensions/amqp/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=== 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 features requiring object serialization

Support for features requiring object serialization such as the `transferExchange` option and `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.
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,7 @@ FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

CamelSerializationBuildItem serialization() {
return new CamelSerializationBuildItem();
}
}
13 changes: 13 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,16 @@

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 features requiring object serialization

Support for features requiring object serialization such as the `transferExchange` option and `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.
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,8 @@ public class CamelSjmsProcessor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

CamelSerializationBuildItem serialization() {
return new CamelSerializationBuildItem();
}
}
12 changes: 12 additions & 0 deletions extensions/sjms/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
=== Native mode support for features requiring object serialization

Support for features requiring object serialization such as `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.
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,8 @@ public class CamelSjms2Processor {
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

CamelSerializationBuildItem serialization() {
return new CamelSerializationBuildItem();
}
}
12 changes: 12 additions & 0 deletions extensions/sjms2/runtime/src/main/doc/usage.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
=== Native mode support for features requiring object serialization

Support for features requiring object serialization such as `javax.jms.ObjectMessage` must be enabled via a property in `application.properties`.

[source,properties]
----
quarkus.camel.native.reflection.serialization-enabled = true
----

==== javax.jms.ObjectMessage

When sending JMS message payloads as `javax.jms.ObjectMessage`, you must annotate the relevant classes to be serialized with `@RegisterForReflection(serialization = true)`.
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
@@ -0,0 +1,17 @@
## ---------------------------------------------------------------------------
## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
quarkus.camel.native.reflection.serialization-enabled = true
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 0a2065d

Please sign in to comment.