You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2019/12/03 14:39:02 UTC

[GitHub] [camel-k] davesargrad commented on issue #1079: Example Request: CamelJmsToFileExample.java

davesargrad commented on issue #1079: Example Request: CamelJmsToFileExample.java
URL: https://github.com/apache/camel-k/issues/1079#issuecomment-561196437
 
 
   @davsclaus  and @lburgazzoli 
   
   You guys gave me what I needed to get this working.
   
   The following command line successfully runs the JMS integration
   
    kamel run -d mvn:org.apache.activemq:activemq-all:5.5.1 -d mvn:org.apache.activemq:activemq-camel:5.5.1 Sample.java
   
   Sample.java
   ```
   import org.apache.camel.builder.RouteBuilder;
   import org.apache.camel.CamelContext;
   import org.apache.camel.component.jms.JmsComponent;
   import org.apache.camel.ProducerTemplate;
   
   import javax.jms.ConnectionFactory;
   
   import org.apache.activemq.ActiveMQConnectionFactory;
   
   public class Sample extends RouteBuilder {
     @Override
     public void configure() throws Exception {
   
           ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://activemq.svc.ip:61616");
   
           CamelContext context = getContext();
           // Note we can explicit name the component
           context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
   
             from("test-jms:queue:sargradtest.queue")
                   .log("Got a message !");
     }
   }
   ```
   I was able to receive data from a real ActiveMQ service.
   
   ![image](https://user-images.githubusercontent.com/48793689/70060521-b39c1700-15b0-11ea-9521-da02793ae33b.png)
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services