Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147312979
  
    --- Diff: examples/features/sub-modules/inter-broker-bridge/README.md ---
    @@ -0,0 +1,143 @@
    +# Inter-broker Bridging
    +
    +An example project showing how to do different varieties of bridging with 
ActiveMQ brokers.
    +
    +## 5.x to Artemis Camel Bridge
    +
    +This is an example of using Camel in the 5.x broker to bridge messages to 
Artemis. There isn't anything to deploy in this
    +example. It's just a set of instructions.
    +
    +### 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.
    +
    +## Artemis to 5.x JMS Bridge
    --- End diff --
    
    I think the Artemis JMS bridge should be before a secondary “camel” 
solution.


---

Reply via email to