You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gbchriste <ga...@gmail.com> on 2015/12/10 15:37:38 UTC

ActiveMQ Component Questions

Total newbie here with Camel and ActiveMQ.  I've done a bit of prototyping
coding directly against ActiveMQ in Java and .Net but now that I'm thinking
of folding Camel into my plans, I've started looking at the Camel ActiveMQ
component.

Couple of questions.  First, does activemq use a default broker of
tcp://localhost:61616 if I don't otherwise specify?  The reason I'm asking
is I inadvertantly commented out the context.addComponent("activemq",...)
part of my code but I was still able to publish a message to an ActiveMQ
broker running at localhost:61616 and consume it.  My working trial code is
as follows where I'm just posting the body of a file to a topic and then
consuming it back to be processed by a bean:

_context = new DefaultCamelContext();
//        _context.addComponent("activemq",
ActiveMQComponent.activeMQComponent("tcp://localhost:61616"));

       
        
        _context.addRoutes(new RouteBuilder() {;
                @Override
                public void configure() {
                     
from("file:e:\\data\\inbox?noop=true").convertBodyTo(String.class).to("activemq:topic:myfile");
                     
from("activemq:topic:myfile").bean(ProcessMessage.class);
                    
                }
        });

I have 2 routes - one reads the contents of a file and sends to
topic:myfile, the other consumes from topic:myfile and sends it a bean.  You
can see that I left _context.addComponent commented out but the publish and
subscribe still works.

Second, am I correct in my understanding that if I'm using the ActiveMQ
component instead of the JMS component then connection pooling is
automatically turned on?  If so, how do I configure the pool properties?  I
need examples in Java DSL rather than Spring as my intent is to do all my
Camel configuration via Java.

I'm already drinking out of a fire hose trying to wrap my head around the
Camel and ActiveMQ pieces and don't want to insert yet another platform
technology (i.e. Spring) in to the mix at this point.

Thanks,

Gary



--
View this message in context: http://camel.465427.n5.nabble.com/ActiveMQ-Component-Questions-tp5774930.html
Sent from the Camel - Users mailing list archive at Nabble.com.