activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen J <stephen.joy...@mclaneco.com>
Subject Re: EIPs in the ActiveMQ broker and clustering
Date Wed, 03 Dec 2008 13:56:02 GMT

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 <stephen.joyner@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 <stephen.joyner@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.


Mime
View raw message