You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by jbertram <gi...@git.apache.org> on 2017/10/26 20:40:39 UTC

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

GitHub user jbertram opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1616

    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

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jbertram/activemq-artemis master_work

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1616.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1616
    
----
commit 33f637bad1502f300151b1d68e259bd6f2d9c698
Author: Justin Bertram <jb...@apache.org>
Date:   2017-10-26T20:37:17Z

    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

----


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313218
  
    --- Diff: pom.xml ---
    @@ -112,6 +112,7 @@
           <version.org.jacoco.plugin>0.7.9</version.org.jacoco.plugin>
     
           <owasp.version>1.4.3</owasp.version>
    +      <spring.version>3.1.4.RELEASE</spring.version>
    --- End diff --
    
    Wow can we have a newer spring version, this is very old, they’re on 5.0.0 now


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147312753
  
    --- 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)
    --- End diff --
    
    Should it not be directing people to Apache download as official place to get distribution


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313906
  
    --- Diff: pom.xml ---
    @@ -112,6 +112,7 @@
           <version.org.jacoco.plugin>0.7.9</version.org.jacoco.plugin>
     
           <owasp.version>1.4.3</owasp.version>
    +      <spring.version>3.1.4.RELEASE</spring.version>
    --- End diff --
    
    I know, I agree this isn’t your change. But it’s still so very wow if this is new stuff going in for next release


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    In any event, I believe I've addressed all the issues raised by @michaelandrepearce (please comment if not).  This should be ready to merge.


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    I see the doc as just informational.  IMO it's not promoting one option over the other, but simply explaining what options exist.  In any event, I changed it to avoid this potential bit of confusion.


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
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.


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147312523
  
    --- Diff: examples/features/sub-modules/inter-broker-bridge/README.md ---
    @@ -0,0 +1,143 @@
    +# Inter-broker Bridging
    --- End diff --
    
    Can we leave the original title, as it’s only a JMS bridge there are other ways to bridge between brokers that is not JMS and not just ActiveMQ 5.x


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313150
  
    --- Diff: examples/features/sub-modules/inter-broker-bridge/pom.xml ---
    @@ -12,37 +12,24 @@ 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">
    -
    +<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>artemis-jms-bridge-parent</artifactId>
    -  <version>1.0.0-SNAPSHOT</version>
    +  <artifactId>inter-broker-bridge-parent</artifactId>
    --- End diff --
    
    Can we not change the name this is just for JMS, eg there is a way to do this with amqp 


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313493
  
    --- Diff: pom.xml ---
    @@ -112,6 +112,7 @@
           <version.org.jacoco.plugin>0.7.9</version.org.jacoco.plugin>
     
           <owasp.version>1.4.3</owasp.version>
    +      <spring.version>3.1.4.RELEASE</spring.version>
    --- End diff --
    
    Wow yes.


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    @mtaylor, the example already contains a demonstration of the Artemis JMS Bridge.  I'm not sure another example for this would be necessary.


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313440
  
    --- 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)
    --- End diff --
    
    If there was a place on the Apache website where one could download the artemis-jms-client-all jar that would be preferred, of course. I'm not aware of such a place since that jar is not in our distribution.


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313983
  
    --- Diff: pom.xml ---
    @@ -112,6 +112,7 @@
           <version.org.jacoco.plugin>0.7.9</version.org.jacoco.plugin>
     
           <owasp.version>1.4.3</owasp.version>
    +      <spring.version>3.1.4.RELEASE</spring.version>
    --- End diff --
    
    And yes I realise this should have been raised on original pr 


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147315800
  
    --- 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)
    --- End diff --
    
    I’m not saying it’s a blocker I’m saying I’d like to sort it before release


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    You probably should have the component updates on a different commit.


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    Good point.  I removed the activemq-camel dependency, but had to add some others to compensate.


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by mtaylor <gi...@git.apache.org>.
Github user mtaylor commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    This is clearing up something that was already merged, we should probably raise discussion on the original PR if there are issues with the approach.  We could always revert if there are strong objections.  I think there's some confusion around what is the preferred approach, it should be clear that there isn't one.  It's down to what the user wants to do.  @michaelandrepearce Given your experience migrating a broker perhaps you could add an example using the Artemis JMS Bridge.  TBH, I've not looked into the details so be interesting to see how they compare.  My preference would be to have a way of migrating using solely Artemis components as you mentioned.
    
    I've kicked off retest, last run reported no failures, could have been environmental.  


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
     @jbertram as @clebertsuconic i know you didn’t change this, but a lot of content is changed and is promoting a very camel approach over the use of the Artemis JMS bridge. We actually used the JMS bridge and still are, so bit shocked by the change (again realize probably should have raised this on original pr)
    
    Also can we bump bits like spring if now needed 3.x is very old. Also I think as noted camel solution over the existing should be secondary not primary 


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    @mtaylor I have no issue with example of camel also being present if anything I prefer having and showing alternatives. Issue was that the native Artemis solution wasn’t promoted first. 
    @jbertram address this, and the few other comments. I am happy


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147315575
  
    --- 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)
    --- End diff --
    
    Including the "all" clients in the distro is a fine idea, but I don't see that as a blocker for this PR. I don't see a real problem with pointing people to Maven Central.


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by jbertram <gi...@git.apache.org>.
Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147313825
  
    --- Diff: examples/features/sub-modules/inter-broker-bridge/pom.xml ---
    @@ -12,37 +12,24 @@ 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">
    -
    +<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>artemis-jms-bridge-parent</artifactId>
    -  <version>1.0.0-SNAPSHOT</version>
    +  <artifactId>inter-broker-bridge-parent</artifactId>
    --- End diff --
    
    What I think I'll do is move the doc into the actual bridge example so that the inter-broker-bridge-parent can be used for other examples (e.g. AMQP, etc.) in the future.


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by mtaylor <gi...@git.apache.org>.
Github user mtaylor commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    @jbertram I am not sure then why the artemis-jms-bridge example pulls in camel as a dependency?


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/1616


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    Sorry in delay in responding just a busy day.


---

[GitHub] activemq-artemis pull request #1616: ARTEMIS-1467 clean up example

Posted by michaelandrepearce <gi...@git.apache.org>.
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1616#discussion_r147314917
  
    --- 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)
    --- End diff --
    
    It’s a good point we should then have a clients folder to have the client jars in as part of distro, we should sort that rather than pointing to here. I can submit something in next day or two to add a clients section in distro if no one beats me to it 


---

[GitHub] activemq-artemis issue #1616: ARTEMIS-1467 clean up example

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1616
  
    the airlift update broke the distribution...
    
    
    also, I know you didn't change it.. but there are a few classes that you are moving that have the @author tag.. can you use this moment to also change those?


---