You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/11/18 08:06:05 UTC
[camel-quarkus] branch master updated: Initial JMS support
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new f25717a Initial JMS support
new 9a18c74 Merge pull request #430 from lburgazzoli/sjms
f25717a is described below
commit f25717a59260e9ddbc3171bf495a8ab2f11aa28a
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Fri Nov 15 22:11:55 2019 +0100
Initial JMS support
---
.../pages/list-of-camel-quarkus-extensions.adoc | 8 +-
extensions/pom.xml | 1 +
extensions/readme.adoc | 8 +-
extensions/sjms/deployment/pom.xml | 80 ++++++++++
.../sjms/deployment/CamelSjmsProcessor.java | 29 ++++
extensions/sjms/pom.xml | 39 +++++
extensions/sjms/runtime/pom.xml | 82 +++++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 28 ++++
integration-tests/pom.xml | 1 +
integration-tests/sjms/pom.xml | 163 +++++++++++++++++++++
.../quarkus/component/sjms/CamelSjmsResource.java | 76 ++++++++++
.../quarkus/component/sjms/CamelSjmsRoute.java | 28 ++++
.../sjms/src/main/resources/application.properties | 29 ++++
.../component/sjms/it/ArtemisTestResource.java | 52 +++++++
.../quarkus/component/sjms/it/CamelSjmsIT.java | 23 +++
.../quarkus/component/sjms/it/CamelSjmsTest.java | 54 +++++++
.../sjms/src/test/resources/broker.xml | 44 ++++++
pom.xml | 3 +-
poms/bom-deployment/pom.xml | 5 +
poms/bom/pom.xml | 20 +++
20 files changed, 770 insertions(+), 3 deletions(-)
diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
index dc9584e..f2854d5 100644
--- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
+++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc
@@ -6,7 +6,7 @@ As of Camel Quarkus {camel-quarkus-last-release} the following Camel artifacts a
== Camel Components
// components: START
-Number of Camel components: 35 in 31 JAR artifacts (0 deprecated)
+Number of Camel components: 37 in 32 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -93,6 +93,12 @@ Number of Camel components: 35 in 31 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/servlet-component.html[Servlet] (camel-quarkus-servlet) +
`servlet:contextPath` | 0.2 | To use a HTTP Servlet as entry for Camel routes when running in a servlet container.
+| link:https://camel.apache.org/components/latest/sjms-component.html[Simple JMS] (camel-quarkus-sjms) +
+`sjms:destinationType:destinationName` | 0.4.1 | The sjms component (simple jms) allows messages to be sent to (or consumed from) a JMS Queue or Topic (uses JMS 1.x API).
+
+| link:https://camel.apache.org/components/latest/sjms-batch-component.html[Simple JMS Batch] (camel-quarkus-sjms) +
+`sjms-batch:destinationName` | 0.4.1 | The sjms-batch component is a specialized for highly performant, transactional batch consumption from a JMS queue.
+
| link:https://camel.apache.org/components/latest/slack-component.html[Slack] (camel-quarkus-slack) +
`slack:channel` | 0.3 | The slack component allows you to send messages to Slack.
diff --git a/extensions/pom.xml b/extensions/pom.xml
index e1c1730..cf3400a 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -73,6 +73,7 @@
<module>salesforce</module>
<module>scheduler</module>
<module>servlet</module>
+ <module>sjms</module>
<module>slack</module>
<module>snakeyaml</module>
<module>tarfile</module>
diff --git a/extensions/readme.adoc b/extensions/readme.adoc
index 06ab51d..cc312b9 100644
--- a/extensions/readme.adoc
+++ b/extensions/readme.adoc
@@ -5,7 +5,7 @@ Apache Camel Quarkus supports the following Camel artifacts as Quarkus Extension
== Camel Components
// components: START
-Number of Camel components: 35 in 31 JAR artifacts (0 deprecated)
+Number of Camel components: 37 in 32 JAR artifacts (0 deprecated)
[width="100%",cols="4,1,5",options="header"]
|===
@@ -92,6 +92,12 @@ Number of Camel components: 35 in 31 JAR artifacts (0 deprecated)
| link:https://camel.apache.org/components/latest/servlet-component.html[Servlet] (camel-quarkus-servlet) +
`servlet:contextPath` | 0.2 | To use a HTTP Servlet as entry for Camel routes when running in a servlet container.
+| link:https://camel.apache.org/components/latest/sjms-component.html[Simple JMS] (camel-quarkus-sjms) +
+`sjms:destinationType:destinationName` | 0.4.1 | The sjms component (simple jms) allows messages to be sent to (or consumed from) a JMS Queue or Topic (uses JMS 1.x API).
+
+| link:https://camel.apache.org/components/latest/sjms-batch-component.html[Simple JMS Batch] (camel-quarkus-sjms) +
+`sjms-batch:destinationName` | 0.4.1 | The sjms-batch component is a specialized for highly performant, transactional batch consumption from a JMS queue.
+
| link:https://camel.apache.org/components/latest/slack-component.html[Slack] (camel-quarkus-slack) +
`slack:channel` | 0.3 | The slack component allows you to send messages to Slack.
diff --git a/extensions/sjms/deployment/pom.xml b/extensions/sjms/deployment/pom.xml
new file mode 100644
index 0000000..cdc09fd
--- /dev/null
+++ b/extensions/sjms/deployment/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-sjms-parent</artifactId>
+ <version>0.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>camel-quarkus-sjms-deployment</artifactId>
+ <name>Camel Quarkus :: SJMS :: Deployment</name>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-sjms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5-internal</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions/sjms/deployment/src/main/java/org/apache/camel/quarkus/component/sjms/deployment/CamelSjmsProcessor.java b/extensions/sjms/deployment/src/main/java/org/apache/camel/quarkus/component/sjms/deployment/CamelSjmsProcessor.java
new file mode 100644
index 0000000..dd66188
--- /dev/null
+++ b/extensions/sjms/deployment/src/main/java/org/apache/camel/quarkus/component/sjms/deployment/CamelSjmsProcessor.java
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.sjms.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+
+public class CamelSjmsProcessor {
+ private static final String FEATURE = "camel-sjms";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+}
diff --git a/extensions/sjms/pom.xml b/extensions/sjms/pom.xml
new file mode 100644
index 0000000..6876482
--- /dev/null
+++ b/extensions/sjms/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent</artifactId>
+ <version>0.4.1-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>camel-quarkus-sjms-parent</artifactId>
+ <name>Camel Quarkus :: SJMS</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+
+</project>
diff --git a/extensions/sjms/runtime/pom.xml b/extensions/sjms/runtime/pom.xml
new file mode 100644
index 0000000..5f81e29
--- /dev/null
+++ b/extensions/sjms/runtime/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-sjms-parent</artifactId>
+ <version>0.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>camel-quarkus-sjms</artifactId>
+ <name>Camel Quarkus :: SJMS :: Runtime</name>
+
+ <properties>
+ <firstVersion>0.4.1</firstVersion>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-sjms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_2.0_spec</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/extensions/sjms/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/sjms/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000..3ae3b6e
--- /dev/null
+++ b/extensions/sjms/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,28 @@
+#
+# 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.
+#
+
+---
+name: "Camel Quarkus SJMS"
+description: "Camel Quqrkus JMS support"
+metadata:
+ keywords:
+ - "camel"
+ - "messaging"
+ - "jms"
+ guide: "https://quarkus.io/guides/camel"
+ categories:
+ - "integration"
\ No newline at end of file
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 1338bdf..468c7ce 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -104,6 +104,7 @@
<module>salesforce</module>
<module>servlet</module>
<module>scheduler</module>
+ <module>sjms</module>
<module>slack</module>
<module>snakeyaml</module>
<module>tarfile</module>
diff --git a/integration-tests/sjms/pom.xml b/integration-tests/sjms/pom.xml
new file mode 100644
index 0000000..3bd179b
--- /dev/null
+++ b/integration-tests/sjms/pom.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-integration-tests</artifactId>
+ <version>0.4.1-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-sjms</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: SJMS</name>
+ <description>Integration tests for Camel Quarkus SJMS extension</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-sjms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-log</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy-jsonb</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-artemis-jms</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-server</artifactId>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logmanager</groupId>
+ <artifactId>jboss-logmanager</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>commons-logging-jboss-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ <configuration>
+ <systemProperties>
+ <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>native-image</id>
+ <goals>
+ <goal>native-image</goal>
+ </goals>
+ <configuration>
+ <reportErrorsAtRuntime>false</reportErrorsAtRuntime>
+ <cleanupServer>true</cleanupServer>
+ <enableHttpsUrlHandler>true</enableHttpsUrlHandler>
+ <enableServer>false</enableServer>
+ <dumpProxies>false</dumpProxies>
+ <graalvmHome>${graalvmHome}</graalvmHome>
+ <enableJni>true</enableJni>
+ <enableAllSecurityServices>true</enableAllSecurityServices>
+ <disableReports>true</disableReports>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/integration-tests/sjms/src/main/java/org/apache/camel/quarkus/component/sjms/CamelSjmsResource.java b/integration-tests/sjms/src/main/java/org/apache/camel/quarkus/component/sjms/CamelSjmsResource.java
new file mode 100644
index 0000000..3a9e867
--- /dev/null
+++ b/integration-tests/sjms/src/main/java/org/apache/camel/quarkus/component/sjms/CamelSjmsResource.java
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.sjms;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSConsumer;
+import javax.jms.JMSContext;
+import javax.jms.JMSException;
+import javax.jms.JMSProducer;
+import javax.jms.Message;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.json.Json;
+import javax.json.JsonObject;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/test")
+@ApplicationScoped
+public class CamelSjmsResource {
+ @Inject
+ ConnectionFactory connectionFactory;
+
+ @Path("/jms/{queueName}")
+ @POST
+ @Produces(MediaType.APPLICATION_JSON)
+ public JsonObject post(@PathParam("queueName") String queueName, String message) {
+ try (JMSContext context = connectionFactory.createContext(Session.AUTO_ACKNOWLEDGE)) {
+ final JMSProducer producer = context.createProducer();
+ final Queue queue = context.createQueue(queueName);
+
+ producer.send(queue, message);
+ }
+
+ return Json.createObjectBuilder().build();
+ }
+
+ @Path("/jms/{queueName}")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ public JsonObject get(@PathParam("queueName") String queueName) {
+ try (JMSContext context = connectionFactory.createContext(Session.AUTO_ACKNOWLEDGE);
+ JMSConsumer consumer = context.createConsumer(context.createQueue(queueName))) {
+
+ Message msg = consumer.receive(10000L);
+ String body = msg != null ? msg.getBody(String.class) : "";
+
+ return Json.createObjectBuilder()
+ .add("queueName", queueName)
+ .add("body", body)
+ .build();
+ } catch (JMSException e) {
+ throw new RuntimeException("Could not receive message", e);
+ }
+ }
+}
diff --git a/integration-tests/sjms/src/main/java/org/apache/camel/quarkus/component/sjms/CamelSjmsRoute.java b/integration-tests/sjms/src/main/java/org/apache/camel/quarkus/component/sjms/CamelSjmsRoute.java
new file mode 100644
index 0000000..9f43636
--- /dev/null
+++ b/integration-tests/sjms/src/main/java/org/apache/camel/quarkus/component/sjms/CamelSjmsRoute.java
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.sjms;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class CamelSjmsRoute extends RouteBuilder {
+ @Override
+ public void configure() throws Exception {
+ from("sjms:queue:inbound")
+ .to("log:sjms")
+ .to("sjms:queue:outbound");
+ }
+}
diff --git a/integration-tests/sjms/src/main/resources/application.properties b/integration-tests/sjms/src/main/resources/application.properties
new file mode 100644
index 0000000..170c234
--- /dev/null
+++ b/integration-tests/sjms/src/main/resources/application.properties
@@ -0,0 +1,29 @@
+## ---------------------------------------------------------------------------
+## 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
+#
+quarkus.log.file.enable = false
+quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
+quarkus.log.category."org.apache.camel.quarkus.component.sjms".level = DEBUG
+quarkus.log.category."org.apache.activemq.artemis" = WARN
+
+#
+# Quarkus - Artemis
+#
+quarkus.artemis.url = tcp://localhost:61616
\ No newline at end of file
diff --git a/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/ArtemisTestResource.java b/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/ArtemisTestResource.java
new file mode 100644
index 0000000..17e1ecf
--- /dev/null
+++ b/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/ArtemisTestResource.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.sjms.it;
+
+import java.nio.file.Paths;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ;
+import org.apache.commons.io.FileUtils;
+
+import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+
+public class ArtemisTestResource implements QuarkusTestResourceLifecycleManager {
+
+ private EmbeddedActiveMQ embedded;
+
+ @Override
+ public Map<String, String> start() {
+ try {
+ FileUtils.deleteDirectory(Paths.get("./target/artemis").toFile());
+ embedded = new EmbeddedActiveMQ();
+ embedded.start();
+ } catch (Exception e) {
+ throw new RuntimeException("Could not start embedded ActiveMQ server", e);
+ }
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public void stop() {
+ try {
+ embedded.stop();
+ } catch (Exception e) {
+ throw new RuntimeException("Could not stop embedded ActiveMQ server", e);
+ }
+ }
+}
diff --git a/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/CamelSjmsIT.java b/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/CamelSjmsIT.java
new file mode 100644
index 0000000..2c61311
--- /dev/null
+++ b/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/CamelSjmsIT.java
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.sjms.it;
+
+import io.quarkus.test.junit.NativeImageTest;
+
+@NativeImageTest
+public class CamelSjmsIT extends CamelSjmsTest {
+}
diff --git a/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/CamelSjmsTest.java b/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/CamelSjmsTest.java
new file mode 100644
index 0000000..17c6da2
--- /dev/null
+++ b/integration-tests/sjms/src/test/java/org/apache/camel/quarkus/component/sjms/it/CamelSjmsTest.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+package org.apache.camel.quarkus.component.sjms.it;
+
+import java.util.UUID;
+
+import io.quarkus.test.common.QuarkusTestResource;
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.path.json.JsonPath;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@QuarkusTest
+@QuarkusTestResource(ArtemisTestResource.class)
+public class CamelSjmsTest {
+ @Test
+ void testQueueBridge() {
+ String body = UUID.randomUUID().toString();
+
+ RestAssured.given()
+ .contentType("text/plain")
+ .body(body)
+ .post("/test/jms/inbound")
+ .then()
+ .statusCode(200);
+
+ JsonPath result = RestAssured.given()
+ .get("/test/jms/outbound")
+ .then()
+ .statusCode(200)
+ .extract()
+ .body()
+ .jsonPath();
+
+ assertThat(result.getString("queueName")).isEqualTo("outbound");
+ assertThat(result.getString("body")).isEqualTo(body);
+ }
+}
diff --git a/integration-tests/sjms/src/test/resources/broker.xml b/integration-tests/sjms/src/test/resources/broker.xml
new file mode 100644
index 0000000..2a6f911
--- /dev/null
+++ b/integration-tests/sjms/src/test/resources/broker.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<configuration xmlns="urn:activemq"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:activemq /schema/artemis-configuration.xsd">
+ <core xmlns="urn:activemq:core">
+ <paging-directory>./target/artemis/paging</paging-directory>
+ <bindings-directory>./target/artemis/bindings</bindings-directory>
+ <journal-directory>./target/artemis/journal</journal-directory>
+ <large-messages-directory>./target/artemis/large-messages</large-messages-directory>
+
+ <connectors>
+ <connector name="activemq">tcp://localhost:61616</connector>
+ </connectors>
+ <acceptors>
+ <acceptor name="activemq">tcp://localhost:61616</acceptor>
+ </acceptors>
+
+ <security-enabled>false</security-enabled>
+
+ <queues>
+ <queue name="foo">
+ <address>test-jms</address>
+ </queue>
+ </queues>
+ </core>
+</configuration>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index b0391d2..3f4beb4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,7 +46,8 @@
<jetty.version>9.4.18.v20190429</jetty.version>
<xstream.version>1.4.11</xstream.version>
<snakeyaml.version>1.25</snakeyaml.version>
- <joda-time.version>2.10.5</joda-time.version>
+ <geronimo-jms_2.0_spec.version>1.0-alpha-2</geronimo-jms_2.0_spec.version>
+ <artemis.version>2.10.0</artemis.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven.compiler.target>1.8</maven.compiler.target>
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index 70cc754..c629df8 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -240,6 +240,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-sjms-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-slack-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 507cf5a..c9d10cb 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -279,6 +279,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-sjms</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-slack</artifactId>
<version>${camel.version}</version>
</dependency>
@@ -545,6 +550,11 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-sjms</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-slack</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
@@ -620,6 +630,16 @@
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jms_2.0_spec</artifactId>
+ <version>${geronimo-jms_2.0_spec.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-server</artifactId>
+ <version>${artemis.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>