You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "james.seb7" <ja...@gmail.com> on 2015/11/09 12:47:45 UTC

Apache Camel with JMS

Hi,
I'm using Apache Camel 2.15.1 with customized tibco Jms. I have written a
sample Java program which will listen to the topic.The below code shows the
logic.

public static void main(String[] args) throws Exception {
    CamelContext context =  new DefaultCamelContext();
    ConnectionFactory connectionFactory=getJMSConnectionFactory();// Returns
the connection    factory     as   " tcp://ugerjmsp1.com:15070

      TibjmsConnectionFactory tib=new TibjmsConnectionFactory();

                 tib=(TibjmsConnectionFactory) connectionFactory;//type
casting topicConnectionfactory to Tibcoconnection factory.
                  
                     tib.setUserName("ijms12");

                     tib.setUserPassword("password123");

                     System.out.println("TIBJMS connection factorty
is"+tib);//Prints " tcp://ugerjmsp1.com:15070

                     JmsComponent emscomp= JmsComponent.jmsComponent(tib);

                     context.addComponent("jms",emscomp);

                      context.addRoutes(new RouteBuilder() {

                     @Override

                     public void configure() throws Exception {

                    from("*jms*:*topic*:/VB/meServices/Notification:topic")
                          
                           .to("file://src/main/java/agn");
                                      
                     }

              });

              ProducerTemplate template = context.createProducerTemplate();

              context.start();
             
              Thread.sleep(80000);

       } finally {

              context.stop();

       }
here I'm getting the Connection factory value as "
tcp://ugerjmsp1.com:15070". But after Camel changes, the message from topic
is not writing into .to("file://src/main/java/agn") folder. But the message
is available in topic. What is wrong in the code?. Is this code correct ?. 



--
View this message in context: http://camel.465427.n5.nabble.com/Apache-Camel-with-JMS-tp5773528.html
Sent from the Camel - Users mailing list archive at Nabble.com.