You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2017/10/26 15:43:33 UTC
[1/2] activemq-artemis git commit: ARTEMIS-1467 example for bridging
messages from the 5.x broker to Artemis
Repository: activemq-artemis
Updated Branches:
refs/heads/master 7cca9e9b0 -> 77f52f40b
ARTEMIS-1467 example for bridging messages from the 5.x broker to Artemis
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/7dab171d
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/7dab171d
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/7dab171d
Branch: refs/heads/master
Commit: 7dab171d0f7b5570f0ee62886ee40c57e6d71698
Parents: 7cca9e9
Author: Stanislav Knot <sk...@redhat.com>
Authored: Wed Oct 18 10:47:59 2017 +0200
Committer: Justin Bertram <jb...@apache.org>
Committed: Thu Oct 26 10:42:22 2017 -0500
----------------------------------------------------------------------
.../sub-modules/artemis-jms-bridge/README.md | 93 +++++++++++++++++
.../activemq-artemis-camel/pom.xml | 101 +++++++++++++++++++
.../src/main/resources/bridge.xml | 67 ++++++++++++
.../src/main/webapp/WEB-INF/web.xml | 30 ++++++
.../artemis-jms-bridge/pom.xml | 99 ++++++++++++++++++
.../bridge/ConnectionFactoryFactoryBean.java | 35 +++++++
.../artemis/bridge/DestinationFactoryBean.java | 36 +++++++
.../src/main/resources/bridge.xml | 69 +++++++++++++
.../src/main/webapp/WEB-INF/web.xml | 30 ++++++
.../sub-modules/artemis-jms-bridge/pom.xml | 64 ++++++++++++
examples/features/sub-modules/pom.xml | 1 +
11 files changed, 625 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/README.md
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/README.md b/examples/features/sub-modules/artemis-jms-bridge/README.md
new file mode 100644
index 0000000..9f60eb4
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/README.md
@@ -0,0 +1,93 @@
+# artemis-jms-bridge
+
+An example project showing how to do different varieties of bridging with ActiveMQ Brokers.
+
+## ActiveMQ to Artemis Camel Bridge
+
+This is an example of using Camel in the ActiveMQ broker to bridge messages between ActiveMQ and Artemis.
+
+### Prerequisites
+
+- install ActiveMQ
+- install Artemis
+
+### Preparing
+
+From the root directory run `mvn clean package`
+
+Copy activemq-artemis-camel/target/activemq-artemis-camel-1.0.0-SNAPSHOT.war to the deploy dir of the ActiveMQ installation.
+
+Create an instance of the Artemis broker `$ARTEMIS_HOME/bin/artemis create --allow-anonymous --user admin --password password myBroker`
+
+Edit the $ARTEMIS_INSTANCE/etc/broker.xml and change the acceptor to listen to port 61617. Comment or remove all other acceptors.
+
+```xml
+<acceptors>
+ <acceptor name="artemis">tcp://0.0.0.0:61617?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
+</acceptors>
+```
+
+### Testing
+
+Start the Artemis broker.
+
+`$ARTEMIS_INSTANCE/bin/artemis run`
+
+Start the ActiveMQ broker.
+
+`$ACTIVEMQ_HOME/bin/standalone`
+
+Send some messages to the ActiveMQ broker.
+
+`./apache-activemq-5.11.0/bin/activemq producer --user admin --password password --destination queue://TEST.FOO`
+
+Log into the Artemis console and browse the messages in the TEST.FOO queue.
+
+## Artemis to ActiveMQ JMS Bridge
+
+This is an example of using the JMS bridge shipped with the Artemis broker to bridge to ActiveMQ.
+
+###Prerequisites
+
+- install ActiveMQ
+- install Artemis
+
+###Preparing
+
+From the root dir run `mvn clean package`.
+
+Copy artemis-jms-bridge/target/artemis-jms-bridge-1.0.0-SNAPSHOT.war to the web directory of the Artemis installation.
+
+Create an instance of the Artemis broker `$ARTEMIS_HOME/bin/artemis create --allow-anonymous --user admin --password password myBroker`
+
+Edit the $ARTEMIS_INSTANCE/etc/broker.xml and change the acceptor to use invm.
+
+```xml
+<acceptors>
+ <acceptor name="artemis">tcp://0.0.0.0:61617?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>
+ <acceptor name="invm">vm://0</acceptor>
+</acceptors>
+```
+
+Edit the $ARTEMIS_INSTANCE/etc/bootstrap.xml and add the war file.
+
+```xml
+<app url="bridge" war="artemis-jms-bridge-1.0.0-SNAPSHOT.war"/>
+```
+
+###Testing
+
+
+Start the ActiveMQ broker.
+
+`$ACTIVEMQ_HOME/bin/standalone`
+
+Start the Artemis broker.
+
+`$ARTEMIS_INSTANCE/bin/artemis run`
+
+Send some messages to the queue TEST.BAR via the Artemis console.
+
+`$ARTEMIS_INSTANCE/bin/artemis producer --user admin --password password --destination queue://TEST.BAR --url tcp://localhost:61617 --message-count 1`
+
+Log into the ActiveMQ console and browse the messages in the TEST.BAR queue.
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/pom.xml b/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/pom.xml
new file mode 100644
index 0000000..cfe72a7
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/pom.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.artemis.examples</groupId>
+ <artifactId>artemis-jms-bridge-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>activemq-artemis-camel</artifactId>
+
+ <packaging>war</packaging>
+
+ <name>ActiveMQ to Artemis Camel Example</name>
+ <description>An example project showing how to do JMS bridging in ActiveMQ to Artemis using Apache Camel.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+
+ <maven-war-plugin.version>3.1.0</maven-war-plugin.version>
+
+ <camel.version>2.18.1</camel.version>
+ <spring.version>4.3.4.RELEASE</spring.version>
+ <slf4j-jboss-logging.version>1.1.0.Final</slf4j-jboss-logging.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-client</artifactId>
+ <version>5.11.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-camel</artifactId>
+ <version>5.11.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-jms-client</artifactId>
+ <version>2.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jms</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.slf4j</groupId>
+ <artifactId>slf4j-jboss-logging</artifactId>
+ <version>${slf4j-jboss-logging.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>${maven-war-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/resources/bridge.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/resources/bridge.xml b/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/resources/bridge.xml
new file mode 100644
index 0000000..23224b4
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/resources/bridge.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <bean id="artemisConnectionFactory"
+ class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616"/>
+ <property name="userName" value="admin"/>
+ <property name="password" value="password"/>
+ </bean>
+
+ <bean id="jmsConfig"
+ class="org.apache.camel.component.jms.JmsConfiguration">
+ <property name="connectionFactory" ref="artemisConnectionFactory"/>
+ <property name="concurrentConsumers" value="10"/>
+ </bean>
+
+ <bean id="activemq"
+ class="org.apache.activemq.camel.component.ActiveMQComponent">
+ <property name="configuration" ref="jmsConfig"/>
+ </bean>
+
+ <bean id="artemisConnectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
+ <constructor-arg name="url" value="tcp://localhost:61617"/>
+ <constructor-arg name="user" value="admin"/>
+ <constructor-arg name="password" value="password"/>
+ </bean>
+
+ <bean id="artemisConfig"
+ class="org.apache.camel.component.jms.JmsConfiguration">
+ <property name="connectionFactory" ref="artemisConnectionFactory"/>
+ <property name="concurrentConsumers" value="10"/>
+ </bean>
+
+ <bean id="artemis"
+ class="org.apache.camel.component.jms.JmsComponent">
+ <property name="configuration" ref="artemisConfig"/>
+ </bean>
+
+
+
+ <camelContext id="bridgeContext" trace="false" xmlns="http://camel.apache.org/schema/spring">
+
+ <route id="bridge_TEST.FOO">
+ <from uri="activemq:queue:TEST.FOO"/>
+ <to uri="artemis:queue:TEST.FOO"/>
+ </route>
+
+ </camelContext>
+
+</beans>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/webapp/WEB-INF/web.xml b/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..710cad2
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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.
+-->
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+ version="3.1">
+
+ <display-name>JMS Bridge Loader</display-name>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath:bridge.xml</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+</web-app>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/pom.xml b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/pom.xml
new file mode 100644
index 0000000..3f34937
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.artemis.examples</groupId>
+ <artifactId>artemis-jms-bridge-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>artemis-jms-bridge</artifactId>
+
+ <packaging>war</packaging>
+
+ <name>Artemis JMS Bridge Example</name>
+ <description>An example project showing how to do JMS bridging in Artemis to an ActiveMQ.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+
+ <maven-war-plugin.version>3.1.0</maven-war-plugin.version>
+
+ <camel.version>2.18.1</camel.version>
+ <spring.version>4.3.4.RELEASE</spring.version>
+ <slf4j-jboss-logging.version>1.1.0.Final</slf4j-jboss-logging.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-client</artifactId>
+ <version>5.11.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-camel</artifactId>
+ <version>5.11.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-jms-client</artifactId>
+ <version>2.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-server</artifactId>
+ <version>2.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-jms-server</artifactId>
+ <version>2.0.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${spring.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.slf4j</groupId>
+ <artifactId>slf4j-jboss-logging</artifactId>
+ <version>${slf4j-jboss-logging.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>${maven-war-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java
new file mode 100644
index 0000000..5bf05ea
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java
@@ -0,0 +1,35 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.artemis.bridge;
+
+import javax.jms.ConnectionFactory;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class ConnectionFactoryFactoryBean implements org.apache.activemq.artemis.jms.bridge.ConnectionFactoryFactory {
+
+ private final ConnectionFactory connectionFactory;
+
+ public ConnectionFactoryFactoryBean(ConnectionFactory connectionFactory) {
+ this.connectionFactory = connectionFactory;
+ }
+ @java.lang.Override
+ public java.lang.Object createConnectionFactory() throws Exception {
+ return connectionFactory;
+ }
+}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java
new file mode 100644
index 0000000..00b8b95
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java
@@ -0,0 +1,36 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.artemis.bridge;
+
+import org.apache.activemq.artemis.jms.bridge.DestinationFactory;
+
+import javax.jms.Destination;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class DestinationFactoryBean implements DestinationFactory {
+ private final Destination destination;
+
+ public DestinationFactoryBean(Destination destination) {
+ this.destination = destination;
+ }
+ @Override
+ public Destination createDestination() throws Exception {
+ return destination;
+ }
+}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/resources/bridge.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/resources/bridge.xml b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/resources/bridge.xml
new file mode 100644
index 0000000..ac76647
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/resources/bridge.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean id="activemqConnectionFactory"
+ class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616"/>
+ <property name="userName" value="admin"/>
+ <property name="password" value="password"/>
+ </bean>
+
+ <bean id="activemqConnectionFactoryFactory" class="org.artemis.bridge.ConnectionFactoryFactoryBean">
+ <constructor-arg ref="activemqConnectionFactory"/>
+ </bean>
+
+ <bean id="artemisConnectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
+ <constructor-arg value="vm:0"/>
+ </bean>
+
+ <bean id="artemisConnectionFactoryFactory" class="org.artemis.bridge.ConnectionFactoryFactoryBean">
+ <constructor-arg ref="artemisConnectionFactory"/>
+ </bean>
+
+ <bean id="activemqDestination" class="org.apache.activemq.command.ActiveMQQueue">
+ <constructor-arg value="TEST.BAR"/>
+ </bean>
+
+ <bean id="artemisDestination" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
+ <constructor-arg value="TEST.BAR"/>
+ </bean>
+
+ <bean id="activemqDestinationFactory" class="org.artemis.bridge.DestinationFactoryBean">
+ <constructor-arg ref="activemqDestination"/>
+ </bean>
+
+ <bean id="artemisDestinationFactory" class="org.artemis.bridge.DestinationFactoryBean">
+ <constructor-arg ref="artemisDestination"/>
+ </bean>
+
+ <bean id="artemis-jms-bridge" class="org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl" init-method="start" destroy-method="stop">
+ <property name="bridgeName" value="artemis-jms-bridge"/>
+ <property name="sourceConnectionFactoryFactory" ref="artemisConnectionFactoryFactory"/>
+ <property name="targetConnectionFactoryFactory" ref="activemqConnectionFactoryFactory"/>
+ <property name="sourceDestinationFactory" ref="artemisDestinationFactory"/>
+ <property name="targetDestinationFactory" ref="activemqDestinationFactory"/>
+ <property name="qualityOfServiceMode" value="AT_MOST_ONCE"/>
+ <property name="failureRetryInterval" value="5000"/>
+ <property name="failoverTimeout" value="5000"/>
+ <property name="maxRetries" value="-1"/>
+ <property name="maxBatchSize" value="1"/>
+ <property name="maxBatchTime" value="-1"/>
+ </bean>
+
+
+</beans>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..710cad2
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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.
+-->
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+ version="3.1">
+
+ <display-name>JMS Bridge Loader</display-name>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath:bridge.xml</param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+</web-app>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/artemis-jms-bridge/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/artemis-jms-bridge/pom.xml b/examples/features/sub-modules/artemis-jms-bridge/pom.xml
new file mode 100644
index 0000000..2b46a9d
--- /dev/null
+++ b/examples/features/sub-modules/artemis-jms-bridge/pom.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed 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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.artemis.examples</groupId>
+ <artifactId>artemis-jms-bridge-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+
+ <packaging>pom</packaging>
+
+ <name>Active Messaging Bridge Examples</name>
+ <description>An example project showing different ways to use bridges with ActiveMQ and Artemis.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <maven.compiler.source>8</maven.compiler.source>
+ <maven.compiler.target>8</maven.compiler.target>
+
+ <maven-war-plugin.version>3.1.0</maven-war-plugin.version>
+
+ <camel.version>2.18.1</camel.version>
+ <spring.version>4.3.4.RELEASE</spring.version>
+ <slf4j-jboss-logging.version>1.1.0.Final</slf4j-jboss-logging.version>
+ </properties>
+
+ <modules>
+ <module>activemq-artemis-camel</module>
+ <module>artemis-jms-bridge</module>
+ </modules>
+
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>fuse-public-repository</id>
+ <name>FuseSource Community Release Repository</name>
+ <url>https://repo.fusesource.com/nexus/content/groups/public</url>
+ </repository>
+ </repositories>
+
+</project>
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/7dab171d/examples/features/sub-modules/pom.xml
----------------------------------------------------------------------
diff --git a/examples/features/sub-modules/pom.xml b/examples/features/sub-modules/pom.xml
index d48371e..c49c758 100644
--- a/examples/features/sub-modules/pom.xml
+++ b/examples/features/sub-modules/pom.xml
@@ -50,6 +50,7 @@ under the License.
<id>release</id>
<modules>
<module>artemis-ra-rar</module>
+ <module>artemis-jms-bridge</module>
</modules>
</profile>
</profiles>
[2/2] activemq-artemis git commit: This closes #1594
Posted by jb...@apache.org.
This closes #1594
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/77f52f40
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/77f52f40
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/77f52f40
Branch: refs/heads/master
Commit: 77f52f40b6df421a9645346a84467d47f81d4b33
Parents: 7cca9e9 7dab171
Author: Justin Bertram <jb...@apache.org>
Authored: Thu Oct 26 10:43:12 2017 -0500
Committer: Justin Bertram <jb...@apache.org>
Committed: Thu Oct 26 10:43:12 2017 -0500
----------------------------------------------------------------------
.../sub-modules/artemis-jms-bridge/README.md | 93 +++++++++++++++++
.../activemq-artemis-camel/pom.xml | 101 +++++++++++++++++++
.../src/main/resources/bridge.xml | 67 ++++++++++++
.../src/main/webapp/WEB-INF/web.xml | 30 ++++++
.../artemis-jms-bridge/pom.xml | 99 ++++++++++++++++++
.../bridge/ConnectionFactoryFactoryBean.java | 35 +++++++
.../artemis/bridge/DestinationFactoryBean.java | 36 +++++++
.../src/main/resources/bridge.xml | 69 +++++++++++++
.../src/main/webapp/WEB-INF/web.xml | 30 ++++++
.../sub-modules/artemis-jms-bridge/pom.xml | 64 ++++++++++++
examples/features/sub-modules/pom.xml | 1 +
11 files changed, 625 insertions(+)
----------------------------------------------------------------------