You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jgunz <sl...@twcny.rr.com> on 2007/09/04 22:42:57 UTC
EIPs in the ActiveMQ broker and clustering
I've been reading through the Camel documentation and about its incorporation
in ActiveMQ 5.x at
http://activemq.apache.org/enterprise-integration-patterns.html. I think the
combination is going to be very useful to me and am just brainstorming about
how I am going to apply both ActiveMQ and Camel in an upcoming project.
How will the EIPs work with clustering? In particular, I'm wondering if
there will be any issue if I install a simple routing rule to copy messages
from topic foo to topic bar if I have a cluster of several ActiveMQ brokers
(each of which will each probably have the routing rule installed).
I'm not all that familiar with how clustering works so this may be a dumb
question.
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tf4380185s2354.html#a12486255
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by James Strachan <ja...@gmail.com>.
On 9/5/07, jgunz <sl...@twcny.rr.com> wrote:
> I realized after I sent my original message that I didn't specify what type
> of clustering I was referring to. I think I understand how the routing rules
> would work in a master/slave setup but I'm still a little foggy on how they
> would function in a store and forward network of brokers. My goal in
> clustering would be to scale the brokering (and separately the processing)
> across multiple machines so I could just throw more CPUs at the problem if I
> need to later.
>
> Ideally I'd like to be able to add brokers or consumers without having to
> configure each one specially (or at least only having to do so minimally).
You typically only need a few brokers (usually one is enough :).
Though the processing of the messages can often be costly, so if
you've alot of heavy processing to do, you might wanna run a cluster
of processors processing messages. ActiveMQ is a great high
performance reliable load balancer and is a very good choice for this
purpose thanks to Queues.
So you might find its easier to do your Camel processing using a
spring.xml and wrapping that up with Spring-OSGi to make an OSGi
bundle and deploying it on as many machines as you need. So basically
make an OSGi bundle with your META-INF/spring/camel-context.xml in it
along with whatever jars you need; then just deploy on your OSGi
containers.
In terms of the ActiveMQ configuration; its usually just a single URL
which you can either hardwire in your spring.xml or parameterize using
the spring property resolving stuff; if you've only a few brokers you
can just list them using the failover URL...
http://activemq.apache.org/failover-transport-reference.html
If you need tons of brokers; you could use multicast discovery, so
JVMs discover the available brokers.
> So if I setup an ActiveMQ installation, if I wanted to improve the
> throughput or capacity I could basically take the same installation and put
> it on another machine and that's it.
Agreed.
> If I did that and I distributed the
> same routing rules to each, would that cause weird message duplication as
> messages were forwarded between brokers and each of them duplicated the
> application of the routing rule?
If you duplicate the Camel processing code to multiple JVMs (using
OSGi or a stand alone main in a shell script or WAR etc) and you use
queues to balance the load then you'll have reliable processing of
messages without duplication (as queues guarantee only one consumer
processes a message). If you are dealing with any unreliable kinds of
messages or protocols, there's always the Idempotent Consumer to
help...
http://activemq.apache.org/camel/idempotent-consumer.html
> In regards to OSGi, your suggestion is music to my ears =) That's precisely
> what I was thinking would be an ideal solution. OSGi could potentially allow
> a consumer application to install a routing rule in the broker so I didn't
> have to statically configure them before deployment.
>
> Thanks for the reply, I'm stoked to get rolling on using some of these great
> features.
My pleasure :)
--
James
-------
http://macstrac.blogspot.com/
Re: EIPs in the ActiveMQ broker and clustering
Posted by jgunz <sl...@twcny.rr.com>.
I realized after I sent my original message that I didn't specify what type
of clustering I was referring to. I think I understand how the routing rules
would work in a master/slave setup but I'm still a little foggy on how they
would function in a store and forward network of brokers. My goal in
clustering would be to scale the brokering (and separately the processing)
across multiple machines so I could just throw more CPUs at the problem if I
need to later.
Ideally I'd like to be able to add brokers or consumers without having to
configure each one specially (or at least only having to do so minimally).
So if I setup an ActiveMQ installation, if I wanted to improve the
throughput or capacity I could basically take the same installation and put
it on another machine and that's it. If I did that and I distributed the
same routing rules to each, would that cause weird message duplication as
messages were forwarded between brokers and each of them duplicated the
application of the routing rule?
In regards to OSGi, your suggestion is music to my ears =) That's precisely
what I was thinking would be an ideal solution. OSGi could potentially allow
a consumer application to install a routing rule in the broker so I didn't
have to statically configure them before deployment.
Thanks for the reply, I'm stoked to get rolling on using some of these great
features.
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tf4380185s2354.html#a12497456
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by Stephen J <st...@mclaneco.com>.
I'm still struggling to figure out how this is going to work in my bizarre
setup.
The JMS Bridge is currently pulling from an MQ queue then transferring to a
Virtual Destination which has another MQ queue defined as a destination.
In other words ActiveMQ is doing all the transfer work by pulling from 1
queue and putting to another. This works fine using JMS bridging and the
pure master-slave setup, but I can't figure out how to create comparable
camel routes to do the same thing as the JMS Bridging.
When I try to use camel routes to do the same thing as the JMS bridge the
routes come up active on both the master and slave. I can't get them to only
work on the master, then fail over to the slave if the master gets killed.
Thanks for the any help!
James.Strachan wrote:
>
> 2008/12/3 Stephen J <st...@mclaneco.com>:
>>
>> I think I need to explain what I'm trying to do in more detail. I want to
>> use
>> ActiveMQ as a broker between two MQ series message queues. I can do this
>> with JMS bridging in a master/slave configuration.
>>
>> However, I saw that JMS bridging is being deprecated, so I was going to
>> use
>> camel routes instead, as was suggested to another user on the forums. The
>> master/slave part using camel routes doesn't work like the JMS bridging.
>>
>> With JMS bridging only 1 server at a time is brokering the messages
>> between
>> the MQ queues. With the camel routes, both the master and the slave come
>> up
>> with live routes, so either one could be brokering messages between the
>> queues.
>
> Hosting the Camel route inside master and slave will indeed run those
> routes on both JVMs. However if you are connecting to the brokers via
> TCP with failover (as I described in a previous mail in this thread) -
> the routes running in the slave JVM will actually connect to the
> master.
>
>
>> I can't use the ActiveMQ failover transport because I don't control the
>> clients or the MQ servers.
>> The only thing I can control is the ActiveMQ
>> broker between the two MQ servers.
>
> So
>
> (i) configure your ActiveMQ brokers master/slave and
> (ii) configure the camel routes to use failover to the 2 brokers
> using TCP as I described in the previous mail
>
>
>> The issue I am concerned about is setting up JMS bridging then having
>> that
>> deprecated in new versions of ActiveMQ and not being able to do the same
>> things with camel routes. I really would like to use Camel routes because
>> of
>> the great power and flexibility of Camel.
>
> Camel is never gonna be deprecated so moving to it will be a great choice
> :)
>
>> Sorry if I didn't make this clear before. I appreciate your help on this.
>>
>> I think ActiveMQ and Camel are some of the best pieces of software I have
>> ever seen. Thanks to all who have worked on these products.
>
> Thanks!
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>
>
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20843368.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by James Strachan <ja...@gmail.com>.
2008/12/3 Stephen J <st...@mclaneco.com>:
>
> I think I need to explain what I'm trying to do in more detail. I want to use
> ActiveMQ as a broker between two MQ series message queues. I can do this
> with JMS bridging in a master/slave configuration.
>
> However, I saw that JMS bridging is being deprecated, so I was going to use
> camel routes instead, as was suggested to another user on the forums. The
> master/slave part using camel routes doesn't work like the JMS bridging.
>
> With JMS bridging only 1 server at a time is brokering the messages between
> the MQ queues. With the camel routes, both the master and the slave come up
> with live routes, so either one could be brokering messages between the
> queues.
Hosting the Camel route inside master and slave will indeed run those
routes on both JVMs. However if you are connecting to the brokers via
TCP with failover (as I described in a previous mail in this thread) -
the routes running in the slave JVM will actually connect to the
master.
> I can't use the ActiveMQ failover transport because I don't control the
> clients or the MQ servers.
> The only thing I can control is the ActiveMQ
> broker between the two MQ servers.
So
(i) configure your ActiveMQ brokers master/slave and
(ii) configure the camel routes to use failover to the 2 brokers
using TCP as I described in the previous mail
> The issue I am concerned about is setting up JMS bridging then having that
> deprecated in new versions of ActiveMQ and not being able to do the same
> things with camel routes. I really would like to use Camel routes because of
> the great power and flexibility of Camel.
Camel is never gonna be deprecated so moving to it will be a great choice :)
> Sorry if I didn't make this clear before. I appreciate your help on this.
>
> I think ActiveMQ and Camel are some of the best pieces of software I have
> ever seen. Thanks to all who have worked on these products.
Thanks!
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: EIPs in the ActiveMQ broker and clustering
Posted by Stephen J <st...@mclaneco.com>.
I think I need to explain what I'm trying to do in more detail. I want to use
ActiveMQ as a broker between two MQ series message queues. I can do this
with JMS bridging in a master/slave configuration.
However, I saw that JMS bridging is being deprecated, so I was going to use
camel routes instead, as was suggested to another user on the forums. The
master/slave part using camel routes doesn't work like the JMS bridging.
With JMS bridging only 1 server at a time is brokering the messages between
the MQ queues. With the camel routes, both the master and the slave come up
with live routes, so either one could be brokering messages between the
queues.
I can't use the ActiveMQ failover transport because I don't control the
clients or the MQ servers. The only thing I can control is the ActiveMQ
broker between the two MQ servers.
The issue I am concerned about is setting up JMS bridging then having that
deprecated in new versions of ActiveMQ and not being able to do the same
things with camel routes. I really would like to use Camel routes because of
the great power and flexibility of Camel.
Sorry if I didn't make this clear before. I appreciate your help on this.
I think ActiveMQ and Camel are some of the best pieces of software I have
ever seen. Thanks to all who have worked on these products.
James.Strachan wrote:
>
> 2008/12/3 Stephen J <st...@mclaneco.com>:
>>
>> I wondered about that. How would I change my camel configuration to use
>> the
>> ActiveMQ master/slave?
>
> Use the ActiveMQ connection factory using the failover connection URL
> to connect to the master then slave
> failover:(tcp://primary:61616,tcp://secondary:61616)?randomize=false
>
> http://activemq.apache.org/failover-transport-reference.html
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>
>
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20814038.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by James Strachan <ja...@gmail.com>.
2008/12/3 Stephen J <st...@mclaneco.com>:
>
> I wondered about that. How would I change my camel configuration to use the
> ActiveMQ master/slave?
Use the ActiveMQ connection factory using the failover connection URL
to connect to the master then slave
failover:(tcp://primary:61616,tcp://secondary:61616)?randomize=false
http://activemq.apache.org/failover-transport-reference.html
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: EIPs in the ActiveMQ broker and clustering
Posted by Stephen J <st...@mclaneco.com>.
I wondered about that. How would I change my camel configuration to use the
ActiveMQ master/slave?
James.Strachan wrote:
>
> Your camel route isn't using ActiveMQ, so its not using ActiveMQ
> Master/Slave?
>
> 2008/12/3 Stephen J <st...@mclaneco.com>:
>>
>> I've attached my configuration. I removed some of it to keep it shorter.
>> This
>> configuration is being run in a pure master/slave configuration. The JMS
>> bridging works perfectly. If I try to use the camel routes, the routes on
>> both the master and slave become active when I start the brokers. I show
>> 2
>> connections to my MQ Queue, and if I put messages on the outbound MQ
>> queue
>> either of the brokers might pick it up. I verified this by appending the
>> name of the broker to the body of the messages.
>>
>> <beans>
>> <broker xmlns="http://activemq.apache.org/schema/core" persistent="true"
>> brokerName="BROKER01" waitForSlave="true" dataDirectory="${act
>> ivemq.base}/data" useShutdownHook="true">
>>
>> <!-- The store and forward broker networks ActiveMQ will listen to
>> -->
>> <networkConnectors>
>> <!-- by default just auto discover the other brokers -->
>> <networkConnector name="default-nc"
>> uri="multicast://default"/>
>> <!-- Example of a static configuration:
>> <networkConnector name="host1 and host2"
>> uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
>> -->
>> </networkConnectors>
>>
>> ### Removed for brevity ###
>>
>> <!-- The transport connectors ActiveMQ will listen to -->
>> <transportConnectors>
>> <transportConnector name="openwire"
>> uri="tcp://localhost:61616"
>> discoveryUri="multicast://default"/>
>> <transportConnector name="ssl" uri="ssl://localhost:61617"/>
>> <transportConnector name="stomp"
>> uri="stomp://localhost:61613"/>
>> <transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
>> </transportConnectors>
>>
>> <destinationInterceptors>
>> <virtualDestinationInterceptor>
>> <virtualDestinations>
>> <compositeQueue name="VRT.MQTEST.WITH.AUDIT">
>> <forwardTo>
>> <queue physicalName="MQTEST.AUDIT" />
>> <queue physicalName="OUT_TRX" />
>> </forwardTo>
>> </compositeQueue>
>> </virtualDestinations>
>> </virtualDestinationInterceptor>
>> </destinationInterceptors>
>> <!-- The bridges work -->
>> <jmsBridgeConnectors>
>> <jmsQueueConnector
>> outboundQueueConnectionFactory="#mqXAConFactory"
>> outboundUsername=" " outboundPassword=" " >
>> <inboundQueueBridges>
>> <inboundQueueBridge
>> inboundQueueName="AMQ.TEST.OUTBOUND"
>> localQueueName="VRT.MQTEST.WITH.AUDIT" />
>> </inboundQueueBridges>
>> <outboundQueueBridges>
>> <outboundQueueBridge localQueueName="OUT_TRX"
>> outboundQueueName="AMQ.TEST.INBOUND" />
>> </outboundQueueBridges>
>> </jmsQueueConnector>
>> </jmsBridgeConnectors>
>>
>> </broker>
>> <camelContext id="camel"
>> xmlns="http://activemq.apache.org/camel/schema/spring">
>> <route>
>> <from uri="mqtestserver:AMQ.TEST.OUTBOUND"/>
>> <setBody>
>> <simple>broker1: ${in.body}</simple>
>> </setBody>
>> <to uri="mqtestserver:AMQ.TEST.INBOUND"/>
>> </route>
>> </camelContext>
>> <bean id="mqtestserver"
>> class="org.apache.camel.component.jms.JmsComponent">
>> <property name="configuration" ref="jmsConfig" />
>> </bean>
>>
>> <bean id="jmsConfig"
>> class="org.apache.camel.component.jms.JmsConfiguration">
>> <property name="connectionFactory"
>> ref="mqProxyConnectionFactory" />
>> </bean>
>> <bean id="mqProxyConnectionFactory"
>> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
>> <property name="targetConnectionFactory" ref="mqXAConFactory"/>
>> <property name="username" value=" "/>
>> <property name="password" value=" "/>
>> </bean>
>> <bean id="mqXAConFactory"
>> class="com.ibm.mq.jms.MQXAQueueConnectionFactory">
>> <property name="hostName" value="myMQserver.domain.com"/>
>> <property name="queueManager" value="QM_MYQUEUEMANAGER"/>
>> <property name="transportType" value="1"/>
>> <property name="port" value="1414"/>
>> </bean>
>> </beans>
>>
>>
>>
>> James.Strachan wrote:
>>>
>>> 2008/12/2 Stephen J <st...@mclaneco.com>:
>>>> Unfortunately, I have found with ActiveMQ 5.2 that when you have a
>>>> Master/Slave configured with identical camel routes, both routes are
>>>> active
>>>> and will process records. The master/slave failover doesn't seem to
>>>> apply
>>>> to
>>>> the camel routes in the ActiveMQ configuration.
>>>
>>> Could you give an example?
>>>
>>> e.g. for master slave to work you must use TCP connections with
>>> failover - using VM transports short circuits the master/slave
>>> functionality.
>>>
>>>> It would be far more convenient if the routes acted like the JMS
>>>> Bridging
>>>> function.
>>>
>>> They do
>>>
>>> --
>>> James
>>> -------
>>> http://macstrac.blogspot.com/
>>>
>>> Open Source Integration
>>> http://fusesource.com/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20812788.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>
>
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20813357.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by James Strachan <ja...@gmail.com>.
Your camel route isn't using ActiveMQ, so its not using ActiveMQ Master/Slave?
2008/12/3 Stephen J <st...@mclaneco.com>:
>
> I've attached my configuration. I removed some of it to keep it shorter. This
> configuration is being run in a pure master/slave configuration. The JMS
> bridging works perfectly. If I try to use the camel routes, the routes on
> both the master and slave become active when I start the brokers. I show 2
> connections to my MQ Queue, and if I put messages on the outbound MQ queue
> either of the brokers might pick it up. I verified this by appending the
> name of the broker to the body of the messages.
>
> <beans>
> <broker xmlns="http://activemq.apache.org/schema/core" persistent="true"
> brokerName="BROKER01" waitForSlave="true" dataDirectory="${act
> ivemq.base}/data" useShutdownHook="true">
>
> <!-- The store and forward broker networks ActiveMQ will listen to
> -->
> <networkConnectors>
> <!-- by default just auto discover the other brokers -->
> <networkConnector name="default-nc" uri="multicast://default"/>
> <!-- Example of a static configuration:
> <networkConnector name="host1 and host2"
> uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
> -->
> </networkConnectors>
>
> ### Removed for brevity ###
>
> <!-- The transport connectors ActiveMQ will listen to -->
> <transportConnectors>
> <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
> <transportConnector name="ssl" uri="ssl://localhost:61617"/>
> <transportConnector name="stomp" uri="stomp://localhost:61613"/>
> <transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
> </transportConnectors>
>
> <destinationInterceptors>
> <virtualDestinationInterceptor>
> <virtualDestinations>
> <compositeQueue name="VRT.MQTEST.WITH.AUDIT">
> <forwardTo>
> <queue physicalName="MQTEST.AUDIT" />
> <queue physicalName="OUT_TRX" />
> </forwardTo>
> </compositeQueue>
> </virtualDestinations>
> </virtualDestinationInterceptor>
> </destinationInterceptors>
> <!-- The bridges work -->
> <jmsBridgeConnectors>
> <jmsQueueConnector
> outboundQueueConnectionFactory="#mqXAConFactory"
> outboundUsername=" " outboundPassword=" " >
> <inboundQueueBridges>
> <inboundQueueBridge
> inboundQueueName="AMQ.TEST.OUTBOUND"
> localQueueName="VRT.MQTEST.WITH.AUDIT" />
> </inboundQueueBridges>
> <outboundQueueBridges>
> <outboundQueueBridge localQueueName="OUT_TRX"
> outboundQueueName="AMQ.TEST.INBOUND" />
> </outboundQueueBridges>
> </jmsQueueConnector>
> </jmsBridgeConnectors>
>
> </broker>
> <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> <route>
> <from uri="mqtestserver:AMQ.TEST.OUTBOUND"/>
> <setBody>
> <simple>broker1: ${in.body}</simple>
> </setBody>
> <to uri="mqtestserver:AMQ.TEST.INBOUND"/>
> </route>
> </camelContext>
> <bean id="mqtestserver"
> class="org.apache.camel.component.jms.JmsComponent">
> <property name="configuration" ref="jmsConfig" />
> </bean>
>
> <bean id="jmsConfig"
> class="org.apache.camel.component.jms.JmsConfiguration">
> <property name="connectionFactory"
> ref="mqProxyConnectionFactory" />
> </bean>
> <bean id="mqProxyConnectionFactory"
> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
> <property name="targetConnectionFactory" ref="mqXAConFactory"/>
> <property name="username" value=" "/>
> <property name="password" value=" "/>
> </bean>
> <bean id="mqXAConFactory"
> class="com.ibm.mq.jms.MQXAQueueConnectionFactory">
> <property name="hostName" value="myMQserver.domain.com"/>
> <property name="queueManager" value="QM_MYQUEUEMANAGER"/>
> <property name="transportType" value="1"/>
> <property name="port" value="1414"/>
> </bean>
> </beans>
>
>
>
> James.Strachan wrote:
>>
>> 2008/12/2 Stephen J <st...@mclaneco.com>:
>>> Unfortunately, I have found with ActiveMQ 5.2 that when you have a
>>> Master/Slave configured with identical camel routes, both routes are
>>> active
>>> and will process records. The master/slave failover doesn't seem to apply
>>> to
>>> the camel routes in the ActiveMQ configuration.
>>
>> Could you give an example?
>>
>> e.g. for master slave to work you must use TCP connections with
>> failover - using VM transports short circuits the master/slave
>> functionality.
>>
>>> It would be far more convenient if the routes acted like the JMS Bridging
>>> function.
>>
>> They do
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20812788.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: EIPs in the ActiveMQ broker and clustering
Posted by Stephen J <st...@mclaneco.com>.
I've attached my configuration. I removed some of it to keep it shorter. This
configuration is being run in a pure master/slave configuration. The JMS
bridging works perfectly. If I try to use the camel routes, the routes on
both the master and slave become active when I start the brokers. I show 2
connections to my MQ Queue, and if I put messages on the outbound MQ queue
either of the brokers might pick it up. I verified this by appending the
name of the broker to the body of the messages.
<beans>
<broker xmlns="http://activemq.apache.org/schema/core" persistent="true"
brokerName="BROKER01" waitForSlave="true" dataDirectory="${act
ivemq.base}/data" useShutdownHook="true">
<!-- The store and forward broker networks ActiveMQ will listen to
-->
<networkConnectors>
<!-- by default just auto discover the other brokers -->
<networkConnector name="default-nc" uri="multicast://default"/>
<!-- Example of a static configuration:
<networkConnector name="host1 and host2"
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
-->
</networkConnectors>
### Removed for brevity ###
<!-- The transport connectors ActiveMQ will listen to -->
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
<transportConnector name="xmpp" uri="xmpp://localhost:61222"/>
</transportConnectors>
<destinationInterceptors>
<virtualDestinationInterceptor>
<virtualDestinations>
<compositeQueue name="VRT.MQTEST.WITH.AUDIT">
<forwardTo>
<queue physicalName="MQTEST.AUDIT" />
<queue physicalName="OUT_TRX" />
</forwardTo>
</compositeQueue>
</virtualDestinations>
</virtualDestinationInterceptor>
</destinationInterceptors>
<!-- The bridges work -->
<jmsBridgeConnectors>
<jmsQueueConnector
outboundQueueConnectionFactory="#mqXAConFactory"
outboundUsername=" " outboundPassword=" " >
<inboundQueueBridges>
<inboundQueueBridge
inboundQueueName="AMQ.TEST.OUTBOUND"
localQueueName="VRT.MQTEST.WITH.AUDIT" />
</inboundQueueBridges>
<outboundQueueBridges>
<outboundQueueBridge localQueueName="OUT_TRX"
outboundQueueName="AMQ.TEST.INBOUND" />
</outboundQueueBridges>
</jmsQueueConnector>
</jmsBridgeConnectors>
</broker>
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="mqtestserver:AMQ.TEST.OUTBOUND"/>
<setBody>
<simple>broker1: ${in.body}</simple>
</setBody>
<to uri="mqtestserver:AMQ.TEST.INBOUND"/>
</route>
</camelContext>
<bean id="mqtestserver"
class="org.apache.camel.component.jms.JmsComponent">
<property name="configuration" ref="jmsConfig" />
</bean>
<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory"
ref="mqProxyConnectionFactory" />
</bean>
<bean id="mqProxyConnectionFactory"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="mqXAConFactory"/>
<property name="username" value=" "/>
<property name="password" value=" "/>
</bean>
<bean id="mqXAConFactory"
class="com.ibm.mq.jms.MQXAQueueConnectionFactory">
<property name="hostName" value="myMQserver.domain.com"/>
<property name="queueManager" value="QM_MYQUEUEMANAGER"/>
<property name="transportType" value="1"/>
<property name="port" value="1414"/>
</bean>
</beans>
James.Strachan wrote:
>
> 2008/12/2 Stephen J <st...@mclaneco.com>:
>> Unfortunately, I have found with ActiveMQ 5.2 that when you have a
>> Master/Slave configured with identical camel routes, both routes are
>> active
>> and will process records. The master/slave failover doesn't seem to apply
>> to
>> the camel routes in the ActiveMQ configuration.
>
> Could you give an example?
>
> e.g. for master slave to work you must use TCP connections with
> failover - using VM transports short circuits the master/slave
> functionality.
>
>> It would be far more convenient if the routes acted like the JMS Bridging
>> function.
>
> They do
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://fusesource.com/
>
>
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20812788.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by James Strachan <ja...@gmail.com>.
2008/12/2 Stephen J <st...@mclaneco.com>:
> Unfortunately, I have found with ActiveMQ 5.2 that when you have a
> Master/Slave configured with identical camel routes, both routes are active
> and will process records. The master/slave failover doesn't seem to apply to
> the camel routes in the ActiveMQ configuration.
Could you give an example?
e.g. for master slave to work you must use TCP connections with
failover - using VM transports short circuits the master/slave
functionality.
> It would be far more convenient if the routes acted like the JMS Bridging
> function.
They do
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: EIPs in the ActiveMQ broker and clustering
Posted by Stephen J <st...@mclaneco.com>.
Unfortunately, I have found with ActiveMQ 5.2 that when you have a
Master/Slave configured with identical camel routes, both routes are active
and will process records. The master/slave failover doesn't seem to apply to
the camel routes in the ActiveMQ configuration.
It would be far more convenient if the routes acted like the JMS Bridging
function.
Can you confirm this?
James.Strachan wrote:
>
> On 9/4/07, jgunz <sl...@twcny.rr.com> wrote:
>>
>> I've been reading through the Camel documentation and about its
>> incorporation
>> in ActiveMQ 5.x at
>> http://activemq.apache.org/enterprise-integration-patterns.html. I think
>> the
>> combination is going to be very useful to me and am just brainstorming
>> about
>> how I am going to apply both ActiveMQ and Camel in an upcoming project.
>
> Cool! :)
>
>
>> How will the EIPs work with clustering? In particular, I'm wondering if
>> there will be any issue if I install a simple routing rule to copy
>> messages
>> from topic foo to topic bar if I have a cluster of several ActiveMQ
>> brokers
>> (each of which will each probably have the routing rule installed).
>>
>> I'm not all that familiar with how clustering works so this may be a dumb
>> question.
>
> The EIP patterns would run above the clustering layer. For example if
> you have brokers in a master/slave arrangement to give you HA; so that
> messages are replicated in multiple physical locations in case of
> serious hardware failure - from the Camel perspective, its just normal
> message flows across JMS (using declarative Spring transactions for
> ACID). e.g. a routing rule that copies message from 'foo' to 'bar'
> would logically be deployed in both master and slave brokers; but the
> slave rule would only become active when the slave becomes the master.
>
> The only thing to be careful of is that each broker in the cluster (or
> network of brokers if you are using store and forward) is running the
> same routing rulebase. Right now the routing rules are defined either
> in a jar or a spring XML file; in the future we could come up with
> some kind of cluster-wide rule base for folks who want highly dynamic
> routing rules to be applied across the cluster in a uniform way. Until
> then we just need to make sure that each broker is running with the
> correct routing rules jar or Spring XML.
>
> Maybe if we turned ActiveMQ into an OSGi bundle it might be a bit
> easier to manage running a number of brokers in a master/slave cluster
> with exactly the same classpaths / Camel XML & reduce the possibility
> of inconsistencies.
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
>
--
View this message in context: http://www.nabble.com/EIPs-in-the-ActiveMQ-broker-and-clustering-tp12486255p20801811.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: EIPs in the ActiveMQ broker and clustering
Posted by James Strachan <ja...@gmail.com>.
On 9/4/07, jgunz <sl...@twcny.rr.com> wrote:
>
> I've been reading through the Camel documentation and about its incorporation
> in ActiveMQ 5.x at
> http://activemq.apache.org/enterprise-integration-patterns.html. I think the
> combination is going to be very useful to me and am just brainstorming about
> how I am going to apply both ActiveMQ and Camel in an upcoming project.
Cool! :)
> How will the EIPs work with clustering? In particular, I'm wondering if
> there will be any issue if I install a simple routing rule to copy messages
> from topic foo to topic bar if I have a cluster of several ActiveMQ brokers
> (each of which will each probably have the routing rule installed).
>
> I'm not all that familiar with how clustering works so this may be a dumb
> question.
The EIP patterns would run above the clustering layer. For example if
you have brokers in a master/slave arrangement to give you HA; so that
messages are replicated in multiple physical locations in case of
serious hardware failure - from the Camel perspective, its just normal
message flows across JMS (using declarative Spring transactions for
ACID). e.g. a routing rule that copies message from 'foo' to 'bar'
would logically be deployed in both master and slave brokers; but the
slave rule would only become active when the slave becomes the master.
The only thing to be careful of is that each broker in the cluster (or
network of brokers if you are using store and forward) is running the
same routing rulebase. Right now the routing rules are defined either
in a jar or a spring XML file; in the future we could come up with
some kind of cluster-wide rule base for folks who want highly dynamic
routing rules to be applied across the cluster in a uniform way. Until
then we just need to make sure that each broker is running with the
correct routing rules jar or Spring XML.
Maybe if we turned ActiveMQ into an OSGi bundle it might be a bit
easier to manage running a number of brokers in a master/slave cluster
with exactly the same classpaths / Camel XML & reduce the possibility
of inconsistencies.
--
James
-------
http://macstrac.blogspot.com/