You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by rkparikh <rk...@essar.com> on 2011/02/21 05:05:55 UTC

Not able to configure JDBC Master/Slave Clustering in ActiveMQ 5.4.2

Hi, 

I am trying to configure the JDBC Master/Slave clustering with two
brokers(says BrokerA and BrokerB) on local machines. 

I have follow the below steps to check 
1. Start the brokerA. 
    - it gets the lock on DB table. 
2. Start the brokerB 
    - it is trying to get the lock but not getting it. 
3. Start the client 
    - the client successfully connected to borker A. 
4. Stop brokerA 
    -  the client successfully connected to brokerB 
5. start brokerA. 
6. Stop brokerB. 

Now the problem is, the client is not getting connected to broker A , but it
is continuously trying to connect 
to BrokerB. 
If i started the broker B then the client is connected to BrokerB. 

Can someone help me out regarding this problem.

------------------------------------------------------------------------------------------------------- 
I have attached the files containing the configuration for both brokers. 

Configuration File for Broker A :
----------------------------------------------------------------------------- 
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="BrokerA"
dataDirectory="${activemq.base}/data"
destroyApplicationContextOnStop="true"> 
             <managementContext> 
            <managementContext createConnector="false"/> 
        </managementContext> 
        
                <networkConnectors> 
                        <networkConnector name="linkToBrokerB" 
                uri="static:(tcp://localhost:51616)" duplex="true" 
                networkTTL="3" 
            />             
          </networkConnectors> 
                <!--<networkConnectors> 
              <networkConnector name="linkToBrokerB"
uri="multicast://default" 
                dynamicOnly="true" 
                networkTTL="3" 
                prefetchSize="1" 
                decreaseNetworkConsumerPriority="true"/> 
            </networkConnectors>--> 

        <persistenceAdapter> 
            <!--<kahaDB directory="${activemq.base}/data/kahadb"/>--> 
                        <!--<kahaDB directory="C:/Projects/data/kahadb"/>--> 
                         <jdbcPersistenceAdapter dataSource="#dataSource"/> 
        </persistenceAdapter> 
                  
        
        <transportConnectors> 
                       <transportConnector name="openwire"
uri="tcp://0.0.0.0:61616"   discoveryUri="multicast://default" 
                                           updateClusterClients="true"
rebalanceClusterClients="true"/> 
        </transportConnectors> 

    </broker> 

  
    <import resource="jetty.xml"/> 
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close"> 
    <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/> 
    <property name="url" value="jdbc:oracle:thin:@DT21764:1521:XE"/> 
    <property name="username" value="AMQ_DB"/> 
    <property name="password" value="AMQ_DB"/> 
    <property name="maxActive" value="200"/> 
    <property name="poolPreparedStatements" value="true"/> 
  </bean> 
------------------------------------------------------------------------------ 

Configuration File for Broker B :
-------------------------------------------------------------------------------- 
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="BrokerA"
dataDirectory="${activemq.base}/data"
destroyApplicationContextOnStop="true"> 
             <managementContext> 
            <managementContext createConnector="false"/> 
        </managementContext> 
        
                <networkConnectors> 
                        <networkConnector name="linkToBrokerA" 
                uri="static:(tcp://localhost:61616)" duplex="true" 
                networkTTL="3" 
            />             
          </networkConnectors> 
                <!--<networkConnectors> 
              <networkConnector name="linkToBrokerA"
uri="multicast://default" 
                dynamicOnly="true" 
                networkTTL="3" 
                prefetchSize="1" 
                decreaseNetworkConsumerPriority="true"/> 
            </networkConnectors>--> 

        <persistenceAdapter> 
            <!--<kahaDB directory="${activemq.base}/data/kahadb"/>--> 
                        <!--<kahaDB directory="C:/Projects/data/kahadb"/>--> 
                         <jdbcPersistenceAdapter dataSource="#dataSource"/> 
        </persistenceAdapter> 
                  
        
        <transportConnectors> 
                       <transportConnector name="openwire"
uri="tcp://0.0.0.0:51616"   discoveryUri="multicast://default" 
                                           updateClusterClients="true"
rebalanceClusterClients="true"/> 
        </transportConnectors> 

    </broker> 

  
    <import resource="jetty.xml"/> 
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close"> 
    <property name="driverClassName"
value="oracle.jdbc.driver.OracleDriver"/> 
    <property name="url" value="jdbc:oracle:thin:@DT21764:1521:XE"/> 
    <property name="username" value="AMQ_DB"/> 
    <property name="password" value="AMQ_DB"/> 
    <property name="maxActive" value="200"/> 
    <property name="poolPreparedStatements" value="true"/> 
  </bean> 
------------------------------------------------------------------ 
Also at client side i have used below configuration:

failover:(tcp://DT21764:61616,tcp://DT21764:51616)?reconnectDelay=20&maxReconnectDelay=10&randomize=true 
-------------------------------------------------------------------------------------------------------

-----
Thanks and Regards,
Rahul
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Not-able-to-configure-JDBC-Master-Slave-Clustering-in-ActiveMQ-5-4-2-tp3316794p3316794.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Not able to configure JDBC Master/Slave Clustering in ActiveMQ 5.4.2

Posted by rkparikh <rk...@essar.com>.
Thank Gary.

by using the updateURIsSupported=false in the failover uri my problem is
solved.

Thanks a lot.

-----
Thanks and Regards,
Rahul
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Not-able-to-configure-JDBC-Master-Slave-Clustering-in-ActiveMQ-5-4-2-tp3316794p3317184.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Not able to configure JDBC Master/Slave Clustering in ActiveMQ 5.4.2

Posted by Gary Tully <ga...@gmail.com>.
Try with updateURIsSupported=false on the failoveruri, that will stop
the auto update and ensure that the clients url list is static.
It looks like the duplex network may be causing an issue for the
dynamic update feature, I know there was some change on trunk related
to that in the past weeks.
Possibly try with a 5.5-SNAPSHOT and if there still is a problem, open
an issue to track it.

On 21 February 2011 10:57, rkparikh <rk...@essar.com> wrote:
>
> Hi, as per your suggestion i have taken the trace level log for
> failoverTransport Class.
>
> First time it is successfully connected to one of the broker.
>
> When i shutdown the connected borker, it is getting below urlLIst for making
> connections
> urlList connectionList:[tcp://DT21764:51616, tcp://DT21764:61616] [
> addresses of both brokers.]
>
> then i started the first broker and shutdown the another broker , at this
> time it is getting below urlList
> urlList connectionList:[tcp://DT21764:51616] [i.e., address of only one
> broker on which it was connected lastly].
>
>
> Please refer below log.
> ===============================================================================
> [2011-02-21 16:15:32,681] [task-scheduler-1] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Reconnect was
> triggered but transport is not started yet. Wait for start to connect the
> transport.
> [2011-02-21 16:15:32,806] [task-scheduler-1] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Started.
> [2011-02-21 16:15:32,806] [task-scheduler-1] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Waking up
> reconnect task
> [2011-02-21 16:15:32,806] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
> connectionList:[tcp://DT21764:61616, tcp://DT21764:51616]
> [2011-02-21 16:15:32,806] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
> connect to: tcp://DT21764:61616
> [2011-02-21 16:15:32,853] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Connection
> established
> [2011-02-21 16:15:32,853] [ActiveMQ Task] [INFO
> ][org.apache.activemq.transport.failover.FailoverTransport] ==> Successfully
> connected to tcp://DT21764:61616
> [2011-02-21 16:16:00,816] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:61616] [TRACE]
> [org.apache.activemq.transport.failover.FailoverTransport] ==>
> tcp://DT21764:61616 handleTransportFailure: java.io.EOFException
> [2011-02-21 16:16:00,816] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:61616] [WARN ]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
> (DT21764/150.0.149.218:61616) failed to tcp://DT21764:61616 , attempting to
> automatically reconnect due to: java.io.EOFException
> [2011-02-21 16:16:00,816] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:61616] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
> failed with the following exception:
> java.io.EOFException
>        at java.io.DataInputStream.readInt(DataInputStream.java:375)
>        at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
>        at java.lang.Thread.run(Thread.java:662)
> [2011-02-21 16:16:00,816] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
> connectionList:[tcp://DT21764:51616, tcp://DT21764:61616]
> [2011-02-21 16:16:00,816] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
> connect to: tcp://DT21764:51616
> [2011-02-21 16:16:01,269] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Connection
> established
> [2011-02-21 16:16:01,269] [ActiveMQ Task] [INFO ]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Successfully
> reconnected to tcp://DT21764:51616
> [2011-02-21 16:16:35,711] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:51616] [TRACE]
> [org.apache.activemq.transport.failover.FailoverTransport] ==>
> tcp://DT21764:51616 handleTransportFailure: java.io.EOFException
> [2011-02-21 16:16:35,711] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:51616] [WARN ]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
> (DT21764/150.0.149.218:51616) failed to tcp://DT21764:51616 , attempting to
> automatically reconnect due to: java.io.EOFException
> [2011-02-21 16:16:35,711] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:51616] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
> failed with the following exception:
> java.io.EOFException
>        at java.io.DataInputStream.readInt(DataInputStream.java:375)
>        at
> org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
>        at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
>        at java.lang.Thread.run(Thread.java:662)
> [2011-02-21 16:16:35,711] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
> connectionList:[tcp://DT21764:51616]
> [2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
> connect to: tcp://DT21764:51616
> [2011-02-21 16:16:35,726] [ActiveMQ Transport:
> tcp://DT21764/150.0.149.218:51616] [TRACE]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> unconnected
> handleTransportFailure: java.io.EOFException
> [2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Connect fail
> to: tcp://DT21764:51616, reason:
> org.apache.activemq.transport.InactivityIOException: Channel was inactive
> for too long: DT21764/150.0.149.218:51616
> [2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Waiting 10 ms
> before attempting connection.
> [2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
> connectionList:[tcp://DT21764:51616]
> [2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
> connect to: tcp://DT21764:51616
> [2011-02-21 16:16:36,695] [ActiveMQ Task] [DEBUG]
> [org.apache.activemq.transport.failover.FailoverTransport] ==> Connect fail
> to: tcp://DT21764:51616, reason: java.net.ConnectException: Connection
> refused: connect
>
> -----
> Thanks and Regards,
> Rahul
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Not-able-to-configure-JDBC-Master-Slave-Clustering-in-ActiveMQ-5-4-2-tp3316794p3317157.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



--
http://blog.garytully.com
http://fusesource.com

Re: Not able to configure JDBC Master/Slave Clustering in ActiveMQ 5.4.2

Posted by rkparikh <rk...@essar.com>.
Hi, as per your suggestion i have taken the trace level log for
failoverTransport Class.

First time it is successfully connected to one of the broker.

When i shutdown the connected borker, it is getting below urlLIst for making
connections
urlList connectionList:[tcp://DT21764:51616, tcp://DT21764:61616] [
addresses of both brokers.]

then i started the first broker and shutdown the another broker , at this
time it is getting below urlList
urlList connectionList:[tcp://DT21764:51616] [i.e., address of only one
broker on which it was connected lastly].


Please refer below log.
===============================================================================
[2011-02-21 16:15:32,681] [task-scheduler-1] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Reconnect was
triggered but transport is not started yet. Wait for start to connect the
transport.
[2011-02-21 16:15:32,806] [task-scheduler-1] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Started.
[2011-02-21 16:15:32,806] [task-scheduler-1] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Waking up
reconnect task
[2011-02-21 16:15:32,806] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
connectionList:[tcp://DT21764:61616, tcp://DT21764:51616]
[2011-02-21 16:15:32,806] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
connect to: tcp://DT21764:61616
[2011-02-21 16:15:32,853] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Connection
established
[2011-02-21 16:15:32,853] [ActiveMQ Task] [INFO
][org.apache.activemq.transport.failover.FailoverTransport] ==> Successfully
connected to tcp://DT21764:61616
[2011-02-21 16:16:00,816] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:61616] [TRACE]
[org.apache.activemq.transport.failover.FailoverTransport] ==>
tcp://DT21764:61616 handleTransportFailure: java.io.EOFException
[2011-02-21 16:16:00,816] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:61616] [WARN ]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
(DT21764/150.0.149.218:61616) failed to tcp://DT21764:61616 , attempting to
automatically reconnect due to: java.io.EOFException
[2011-02-21 16:16:00,816] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:61616] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
failed with the following exception:
java.io.EOFException
	at java.io.DataInputStream.readInt(DataInputStream.java:375)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
	at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
	at java.lang.Thread.run(Thread.java:662)
[2011-02-21 16:16:00,816] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
connectionList:[tcp://DT21764:51616, tcp://DT21764:61616]
[2011-02-21 16:16:00,816] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
connect to: tcp://DT21764:51616
[2011-02-21 16:16:01,269] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Connection
established
[2011-02-21 16:16:01,269] [ActiveMQ Task] [INFO ]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Successfully
reconnected to tcp://DT21764:51616
[2011-02-21 16:16:35,711] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:51616] [TRACE]
[org.apache.activemq.transport.failover.FailoverTransport] ==>
tcp://DT21764:51616 handleTransportFailure: java.io.EOFException
[2011-02-21 16:16:35,711] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:51616] [WARN ]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
(DT21764/150.0.149.218:51616) failed to tcp://DT21764:51616 , attempting to
automatically reconnect due to: java.io.EOFException
[2011-02-21 16:16:35,711] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:51616] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Transport
failed with the following exception:
java.io.EOFException
	at java.io.DataInputStream.readInt(DataInputStream.java:375)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:269)
	at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:227)
	at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202)
	at java.lang.Thread.run(Thread.java:662)
[2011-02-21 16:16:35,711] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
connectionList:[tcp://DT21764:51616]
[2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
connect to: tcp://DT21764:51616
[2011-02-21 16:16:35,726] [ActiveMQ Transport:
tcp://DT21764/150.0.149.218:51616] [TRACE]
[org.apache.activemq.transport.failover.FailoverTransport] ==> unconnected
handleTransportFailure: java.io.EOFException
[2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Connect fail
to: tcp://DT21764:51616, reason:
org.apache.activemq.transport.InactivityIOException: Channel was inactive
for too long: DT21764/150.0.149.218:51616
[2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Waiting 10 ms
before attempting connection. 
[2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> urlList
connectionList:[tcp://DT21764:51616]
[2011-02-21 16:16:35,726] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Attempting
connect to: tcp://DT21764:51616
[2011-02-21 16:16:36,695] [ActiveMQ Task] [DEBUG]
[org.apache.activemq.transport.failover.FailoverTransport] ==> Connect fail
to: tcp://DT21764:51616, reason: java.net.ConnectException: Connection
refused: connect

-----
Thanks and Regards,
Rahul
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Not-able-to-configure-JDBC-Master-Slave-Clustering-in-ActiveMQ-5-4-2-tp3316794p3317157.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Not able to configure JDBC Master/Slave Clustering in ActiveMQ 5.4.2

Posted by Gary Tully <ga...@gmail.com>.
enable trace level logging of the FailoverTransport class on your client so
see what is going on.

On 21 February 2011 04:05, rkparikh <rk...@essar.com> wrote:

>
> Hi,
>
> I am trying to configure the JDBC Master/Slave clustering with two
> brokers(says BrokerA and BrokerB) on local machines.
>
> I have follow the below steps to check
> 1. Start the brokerA.
>    - it gets the lock on DB table.
> 2. Start the brokerB
>    - it is trying to get the lock but not getting it.
> 3. Start the client
>    - the client successfully connected to borker A.
> 4. Stop brokerA
>    -  the client successfully connected to brokerB
> 5. start brokerA.
> 6. Stop brokerB.
>
> Now the problem is, the client is not getting connected to broker A , but
> it
> is continuously trying to connect
> to BrokerB.
> If i started the broker B then the client is connected to BrokerB.
>
> Can someone help me out regarding this problem.
>
>
> -------------------------------------------------------------------------------------------------------
> I have attached the files containing the configuration for both brokers.
>
> Configuration File for Broker A :
>
> -----------------------------------------------------------------------------
> <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="BrokerA"
> dataDirectory="${activemq.base}/data"
> destroyApplicationContextOnStop="true">
>             <managementContext>
>            <managementContext createConnector="false"/>
>        </managementContext>
>
>                <networkConnectors>
>                        <networkConnector name="linkToBrokerB"
>                uri="static:(tcp://localhost:51616)" duplex="true"
>                networkTTL="3"
>            />
>          </networkConnectors>
>                <!--<networkConnectors>
>              <networkConnector name="linkToBrokerB"
> uri="multicast://default"
>                dynamicOnly="true"
>                networkTTL="3"
>                prefetchSize="1"
>                decreaseNetworkConsumerPriority="true"/>
>            </networkConnectors>-->
>
>        <persistenceAdapter>
>            <!--<kahaDB directory="${activemq.base}/data/kahadb"/>-->
>                        <!--<kahaDB directory="C:/Projects/data/kahadb"/>-->
>                         <jdbcPersistenceAdapter dataSource="#dataSource"/>
>        </persistenceAdapter>
>
>
>        <transportConnectors>
>                       <transportConnector name="openwire"
> uri="tcp://0.0.0.0:61616"   discoveryUri="multicast://default"
>                                           updateClusterClients="true"
> rebalanceClusterClients="true"/>
>        </transportConnectors>
>
>    </broker>
>
>
>    <import resource="jetty.xml"/>
>    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>    <property name="driverClassName"
> value="oracle.jdbc.driver.OracleDriver"/>
>    <property name="url" value="jdbc:oracle:thin:@DT21764:1521:XE"/>
>    <property name="username" value="AMQ_DB"/>
>    <property name="password" value="AMQ_DB"/>
>    <property name="maxActive" value="200"/>
>    <property name="poolPreparedStatements" value="true"/>
>  </bean>
>
> ------------------------------------------------------------------------------
>
> Configuration File for Broker B :
>
> --------------------------------------------------------------------------------
> <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="BrokerA"
> dataDirectory="${activemq.base}/data"
> destroyApplicationContextOnStop="true">
>             <managementContext>
>            <managementContext createConnector="false"/>
>        </managementContext>
>
>                <networkConnectors>
>                        <networkConnector name="linkToBrokerA"
>                uri="static:(tcp://localhost:61616)" duplex="true"
>                networkTTL="3"
>            />
>          </networkConnectors>
>                <!--<networkConnectors>
>              <networkConnector name="linkToBrokerA"
> uri="multicast://default"
>                dynamicOnly="true"
>                networkTTL="3"
>                prefetchSize="1"
>                decreaseNetworkConsumerPriority="true"/>
>            </networkConnectors>-->
>
>        <persistenceAdapter>
>            <!--<kahaDB directory="${activemq.base}/data/kahadb"/>-->
>                        <!--<kahaDB directory="C:/Projects/data/kahadb"/>-->
>                         <jdbcPersistenceAdapter dataSource="#dataSource"/>
>        </persistenceAdapter>
>
>
>        <transportConnectors>
>                       <transportConnector name="openwire"
> uri="tcp://0.0.0.0:51616"   discoveryUri="multicast://default"
>                                           updateClusterClients="true"
> rebalanceClusterClients="true"/>
>        </transportConnectors>
>
>    </broker>
>
>
>    <import resource="jetty.xml"/>
>    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>    <property name="driverClassName"
> value="oracle.jdbc.driver.OracleDriver"/>
>    <property name="url" value="jdbc:oracle:thin:@DT21764:1521:XE"/>
>    <property name="username" value="AMQ_DB"/>
>    <property name="password" value="AMQ_DB"/>
>    <property name="maxActive" value="200"/>
>    <property name="poolPreparedStatements" value="true"/>
>  </bean>
> ------------------------------------------------------------------
> Also at client side i have used below configuration:
>
>
> failover:(tcp://DT21764:61616,tcp://DT21764:51616)?reconnectDelay=20&maxReconnectDelay=10&randomize=true
>
> -------------------------------------------------------------------------------------------------------
>
> -----
> Thanks and Regards,
> Rahul
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Not-able-to-configure-JDBC-Master-Slave-Clustering-in-ActiveMQ-5-4-2-tp3316794p3316794.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com