You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by newbiee <m_...@hotmail.com> on 2011/08/23 23:43:45 UTC

Sending message to different environment

I have just started learning CAMEL. There are some good basic examples to
learn CAMEL. It seems that, using CAMEL, it is so simple to send a message
from one queue to the other. For example he is one example:

from("activemq:queue1”)
.to("activemq:queue2");

The above two lines will do the job. I have tested and it works. I want to
apply this to real world scenario, I need help from experts how can I do
this:

I have a queue say "queue1" defined in the production environment and I have
"queue2" defined in the Staging environment. There is "customerQueue"
defined in our customer's production environment. From
"queue1" I want to send messages to  "queue2" and to "customerQueue". I can
use EIP to send messages from "queue1"  to "queue2" and to "customerQueue"
(more than one recipients). What I don't know is how to tell CAMEL where is 
"queue2" and where is "customerQueue". Please help me.

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-message-to-different-environment-tp4728380p4728380.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending message to different environment

Posted by newbiee <m_...@hotmail.com>.
Also, 

in the follwing code:

from("activemq_production:queue:queue1”) 
.to("activemq_staging:queue:queue2","activemq_customer:queue:customerQueue"); 

Do I need to create queue1, queue2 or customerQueue? or the above "from ->
to" statements will automatically create the queues if they don't exist? 

If the queues are automatically created by the above statements, is it ok to
follow this convention? what is the good programming practive? i.e.
explicitly create the queues or let the above statement create the queues?

Thank you

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-message-to-different-environment-tp4728380p4734069.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending message to different environment

Posted by newbiee <m_...@hotmail.com>.
Thank you very much for such a precise explanation.

Our customer is using IBM MQ, can you also provide SPRING tags to configure
IBM MQ broker?
Also, we used VPN to cennect to our customer Queue, do I need to configure
CAMEL/ACTIVE MQ for the VPN?

Thank you   

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-message-to-different-environment-tp4728380p4734052.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Sending message to different environment

Posted by boday <be...@initekconsulting.com>.
when you setup your "activemq" component (generally in spring xml), you have
to specify the broker to connect to.  this is generally localhost, but can
be an external broker, etc.  So, just setup multiple activemq components
(and give them an appropriate ID)...like this

   <bean id="activemq_production" 
      class="org.apache.activemq.camel.component.ActiveMQComponent">
      <property name="brokerURL" value="tcp://production-host:61616"/>
   </bean>

   <bean id="activemq_customer" 
      class="org.apache.activemq.camel.component.ActiveMQComponent">
      <property name="brokerURL" value="tcp://customer-host:61616"/>
   </bean>

   <bean id="activemq_staging" 
      class="org.apache.activemq.camel.component.ActiveMQComponent">
      <property name="brokerURL" value="tcp://staging-host:61616"/>
   </bean>

then, your route simply references these components/queues, etc...

from("activemq_production:queue:queue1”)
.to("activemq_staging:queue:queue2","activemq_customer:queue:customerQueue");



newbiee wrote:
> 
> I have just started learning CAMEL. There are some good basic examples to
> learn CAMEL. It seems that, using CAMEL, it is so simple to send a message
> from one queue to the other. For example he is one example:
> 
> from("activemq:queue1”)
> .to("activemq:queue2");
> 
> The above two lines will do the job. I have tested and it works. I want to
> apply this to real world scenario, I need help from experts how can I do
> this:
> 
> I have a queue say "queue1" defined in the production environment and I
> have "queue2" defined in the Staging environment. There is "customerQueue"
> defined in our customer's production environment. From
> "queue1" I want to send messages to  "queue2" and to "customerQueue". I
> can use EIP to send messages from "queue1"  to "queue2" and to
> "customerQueue" (more than one recipients). What I don't know is how to
> tell CAMEL where is  "queue2" and where is "customerQueue". Please help
> me.
> 


-----
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: http://camel.465427.n5.nabble.com/Sending-message-to-different-environment-tp4728380p4728626.html
Sent from the Camel - Users mailing list archive at Nabble.com.