ARTEMIS-1467 clean up example - Rename example project - Leverage built-in 5.x Camel support instead of using WAR - Clarify instructions - Fix pom names/structure
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b07588a0 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b07588a0 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b07588a0 Branch: refs/heads/master Commit: b07588a020aa3fb8cc8ac55bda8d555203b93fc9 Parents: 6d8e89d Author: Justin Bertram <jbert...@apache.org> Authored: Thu Oct 26 15:37:17 2017 -0500 Committer: Michael André Pearce <michael.andre.pea...@me.com> Committed: Fri Oct 27 16:44:12 2017 +0100 ---------------------------------------------------------------------- .../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 -------- .../artemis-jms-bridge/README.md | 148 +++++++++++++++++++ .../artemis-jms-bridge/pom.xml | 93 ++++++++++++ .../bridge/ConnectionFactoryFactoryBean.java | 32 ++++ .../artemis/bridge/DestinationFactoryBean.java | 33 +++++ .../src/main/resources/bridge.xml | 66 +++++++++ .../src/main/webapp/WEB-INF/web.xml | 30 ++++ .../sub-modules/inter-broker-bridge/pom.xml | 39 +++++ examples/features/sub-modules/pom.xml | 2 +- pom.xml | 9 +- 19 files changed, 447 insertions(+), 629 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b07588a0/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 deleted file mode 100644 index 9f60eb4..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# 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/b07588a0/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 deleted file mode 100644 index cfe72a7..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/pom.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?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/b07588a0/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 deleted file mode 100644 index 23224b4..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/resources/bridge.xml +++ /dev/null @@ -1,67 +0,0 @@ -<?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/b07588a0/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 deleted file mode 100644 index 710cad2..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/activemq-artemis-camel/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?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/b07588a0/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 deleted file mode 100644 index 3f34937..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/pom.xml +++ /dev/null @@ -1,99 +0,0 @@ -<?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/b07588a0/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 deleted file mode 100644 index 5bf05ea..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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.tay...@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/b07588a0/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 deleted file mode 100644 index 00b8b95..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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.tay...@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/b07588a0/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 deleted file mode 100644 index ac76647..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/resources/bridge.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?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/b07588a0/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 deleted file mode 100644 index 710cad2..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?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/b07588a0/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 deleted file mode 100644 index 2b46a9d..0000000 --- a/examples/features/sub-modules/artemis-jms-bridge/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?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/b07588a0/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/README.md ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/README.md b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/README.md new file mode 100644 index 0000000..f788881 --- /dev/null +++ b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/README.md @@ -0,0 +1,148 @@ +# Artemis to 5.x JMS Bridge + +This is an example of using the JMS bridge shipped with the Artemis broker to bridge to a 5.x broker. + +Notes: + +- The Artemis JMS bridge is a general purpose bridge and can be used to bridge to any JMS provider which implements JNDI. +This example however is just focusing on integration with 5.x. +- The Artemis JMS bridge can "push" _and_ "pull" messages so it can be used to move messages both ways. + +##Prerequisites + +- install ActiveMQ 5.x +- install ActiveMQ Artemis + +##Preparing + +1) From the root dir run `mvn clean package`. + +2) Copy artemis-jms-bridge/target/artemis-jms-bridge-<version>.war to the web directory of the Artemis installation. + +3) Create an instance of the Artemis broker `$ARTEMIS_HOME/bin/artemis create --allow-anonymous myBroker` + +4) Edit the `$ARTEMIS_INSTANCE/etc/broker.xml` and change the `artemis` acceptor to run on 61617 and add the `invm` acceptor. + +```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> +``` + +5) Edit `$ARTEMIS_INSTANCE/etc/bootstrap.xml` and add the war file. + +```xml +<app url="bridge" war="artemis-jms-bridge-<version>.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 --destination queue://TEST.BAR --url tcp://localhost:61617 --message-count 1` + +Log into the ActiveMQ 5.x console and browse the messages in the TEST.BAR queue. + +# 5.x to Artemis Camel JMS Bridge + +This is an alternative to using the Artemis JMS bridge using Camel in the 5.x broker to bridge messages to Artemis. +There isn't anything to deploy here. It's just a set of instructions. + +This approach might be preferred if for example you only have access to the 5.x broker. + +## Prerequisites + +- install ActiveMQ 5.x +- install ActiveMQ Artemis + +## Preparing + +1) Fetch the `artemis-jms-client-all` jar from [Maven Central](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.apache.activemq%22%20AND%20a%3A%22artemis-jms-client-all%22) + which corresponds to the version of ActiveMQ Artemis installed. Copy that jar to the `$5X_HOME/lib` directory. + +2) Add the bridge configuration to `activemq.xml`: + +```xml + <bean id="5xConnectionFactory" 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="5xConnectionFactory"/> + <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"/> + </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> +``` + +3) Ensure the `xsi:schemalocation` in activemq.xml contains the necessary Camel schemas: + +``` +http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd +``` + +4) Create an instance of the Artemis broker `$ARTEMIS_HOME/bin/artemis create --allow-anonymous myBroker` + +5) 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> +``` + +6) Edit `$ARTEMIS_INSTANCE/etc/bootstrap.xml` so that the embedded web server runs on a different port that the 5.x broker (e.g. 8162): + +```xml +<web bind="http://localhost:8162" path="web"> +``` + +## Testing + +Start the Artemis broker. + +`$ARTEMIS_INSTANCE/bin/artemis run` + +Start the ActiveMQ 5.x broker. + +`$5X_HOME/bin/activemq start` + +Send some messages to the ActiveMQ 5.x broker. + +`$5X_HOME/bin/activemq producer --user admin --password password --destination queue://TEST.FOO` + +Log into the ActiveMQ Artemis console and browse the messages in the `TEST.FOO` queue. + http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b07588a0/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/pom.xml b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/pom.xml new file mode 100644 index 0000000..11ee24a --- /dev/null +++ b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/pom.xml @@ -0,0 +1,93 @@ +<?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>inter-broker-bridge-parent</artifactId> + <version>2.4.0-SNAPSHOT</version> + </parent> + + <artifactId>artemis-jms-bridge</artifactId> + + <packaging>war</packaging> + + <name>Artemis JMS Bridge Example</name> + + <properties> + <activemq.basedir>${project.basedir}/../../../../..</activemq.basedir> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>activemq-client</artifactId> + <version>${activemq5-version}</version> + </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-jms-client</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-server</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-jms-server</artifactId> + <version>${project.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-web</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>${spring.version}</version> + </dependency> + <dependency> + <groupId>javax.management.j2ee</groupId> + <artifactId>javax.management.j2ee-api</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>org.jboss.slf4j</groupId> + <artifactId>slf4j-jboss-logging</artifactId> + <version>1.1.0.Final</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>3.1.0</version> + </plugin> + </plugins> + </build> + +</project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b07588a0/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java new file mode 100644 index 0000000..1bf29ce --- /dev/null +++ b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/ConnectionFactoryFactoryBean.java @@ -0,0 +1,32 @@ +/** + * 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; + +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/b07588a0/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java new file mode 100644 index 0000000..f5428fd --- /dev/null +++ b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/java/org/artemis/bridge/DestinationFactoryBean.java @@ -0,0 +1,33 @@ +/** + * 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; + +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/b07588a0/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/resources/bridge.xml ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/resources/bridge.xml b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/resources/bridge.xml new file mode 100644 index 0000000..3409954 --- /dev/null +++ b/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/resources/bridge.xml @@ -0,0 +1,66 @@ +<?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="5xConnectionFactory" 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="5xConnectionFactoryFactory" class="org.artemis.bridge.ConnectionFactoryFactoryBean"> + <constructor-arg ref="5xConnectionFactory"/> + </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="5xDestinationFactory" 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="5xConnectionFactoryFactory"/> + <property name="sourceDestinationFactory" ref="artemisDestinationFactory"/> + <property name="targetDestinationFactory" ref="5xDestinationFactory"/> + <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/b07588a0/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/artemis-jms-bridge/src/main/webapp/WEB-INF/web.xml b/examples/features/sub-modules/inter-broker-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/inter-broker-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/b07588a0/examples/features/sub-modules/inter-broker-bridge/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/inter-broker-bridge/pom.xml b/examples/features/sub-modules/inter-broker-bridge/pom.xml new file mode 100644 index 0000000..3a3d693 --- /dev/null +++ b/examples/features/sub-modules/inter-broker-bridge/pom.xml @@ -0,0 +1,39 @@ +<?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.activemq.examples.modules</groupId> + <artifactId>broker-modules</artifactId> + <version>2.4.0-SNAPSHOT</version> + </parent> + + <groupId>org.apache.artemis.examples</groupId> + <artifactId>inter-broker-bridge-parent</artifactId> + <version>2.4.0-SNAPSHOT</version> + + <packaging>pom</packaging> + + <name>ActiveMQ Artemis Inter-broker Bridging Examples</name> + + <properties> + <activemq.basedir>${project.basedir}/../../../..</activemq.basedir> + </properties> + + <modules> + <module>artemis-jms-bridge</module> + </modules> +</project> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b07588a0/examples/features/sub-modules/pom.xml ---------------------------------------------------------------------- diff --git a/examples/features/sub-modules/pom.xml b/examples/features/sub-modules/pom.xml index c49c758..5330de5 100644 --- a/examples/features/sub-modules/pom.xml +++ b/examples/features/sub-modules/pom.xml @@ -50,7 +50,7 @@ under the License. <id>release</id> <modules> <module>artemis-ra-rar</module> - <module>artemis-jms-bridge</module> + <module>inter-broker-bridge</module> </modules> </profile> </profiles> http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b07588a0/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 74f206d..9a74e95 100644 --- a/pom.xml +++ b/pom.xml @@ -113,6 +113,7 @@ <version.org.jacoco.plugin>0.7.9</version.org.jacoco.plugin> <owasp.version>1.4.3</owasp.version> + <spring.version>5.0.1.RELEASE</spring.version> <activemq.version.versionName>${project.version}</activemq.version.versionName> <activemq.version.majorVersion>1</activemq.version.majorVersion> @@ -318,28 +319,28 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> - <version>3.1.4.RELEASE</version> + <version>${spring.version}</version> <scope>compile</scope> <!-- License: Apache 2.0 --> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> - <version>3.1.4.RELEASE</version> + <version>${spring.version}</version> <scope>compile</scope> <!-- License: Apache 2.0 --> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> - <version>3.1.4.RELEASE</version> + <version>${spring.version}</version> <scope>compile</scope> <!-- License: Apache 2.0 --> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> - <version>3.1.4.RELEASE</version> + <version>${spring.version}</version> <scope>compile</scope> <!-- License: Apache 2.0 --> </dependency>