activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Song <daveson...@gmail.com>
Subject Re: Messages are blocked in queue when using JDBC Master/Slave
Date Sun, 16 Dec 2007 01:49:09 GMT

Thanks for your reply, Hiram.

I have tried to configurate two brokers to use different databases. It was
not Master/Slave anymore. However, I got the same test result. 

I have tried "Network of brokers" solution too. I met another issue which
was similar. Some messages were blocked in queue randomly. And its behavior
had no relations with the interval - 30 seconds. 

Brokers configuration:

BrokerA:

<transportConnectors> 
              <transportConnector  name="openwire"  uri="tcp://host1:61616"  
discoveryUri="multicast://default"/> 
</transportConnectors> 


<networkConnectors>
      <networkConnector name="host2" uri="static://(tcp://host2:61616)"
</networkConnectors>

BrokerB:

<transportConnectors> 
              <transportConnector  name="openwire"  uri="tcp://host2:61616"  
discoveryUri="multicast://default"/> 
</transportConnectors> 

<networkConnectors>
      <networkConnector name="host1" uri="static://(tcp://host1:61616)"
</networkConnectors>

brokerURL: failover:(tcp://192.168.1.102:61616,tcp://192.168.1.236:61616)


Thanks
Dave


Hiram Chirino wrote:
> 
> If you disable database locking.. you need to use some other mechanism
> to stop the slave broker from becoming active while the master is
> online.  If bother brokers become active on the same database scheme
> data corruption can occur and will produce will produce a variety of
> observable 'bugs'
> 
> On Dec 15, 2007 6:03 AM, Dave Song <davesong07@gmail.com> wrote:
>>
>> No. I am using AMQ4.1.1 stable with Spring2.0.
>>
>> Thank you
>>
>>
>>
>> Hiram Chirino wrote:
>> >
>> > You using AMQ 5.0.0 ??
>> >
>> > On Dec 14, 2007 6:23 AM, Dave Song <davesong07@gmail.com> wrote:
>> >>
>> >> Hi,there
>> >>
>> >> I have a question when using JDBC Master/Slave. Some of the messages
>> that
>> >> have sent to queue are not consumed by messageListener
>> >>
>> >>
>> >> I used ActiveMQ with spring. It worked perfect with one broker. the
>> beans
>> >> configuration is like:
>> >>
>> >>
>> >>         <bean id="twoBrokersTestJmsTemplate"
>> >>                 class="org.springframework.jms.core.JmsTemplate">
>> >>                 <property name="defaultDestinationName"
>> >>                         value="ActiveMQ.In.twoBrokersTest" />
>> >>                 <property name="connectionFactory">
>> >>                         <ref bean="twoBrokersTestJmsFactory" />
>> >>                 </property>
>> >>         </bean>
>> >>
>> >>         <bean id="twoBrokersTestJmsFactory"
>> >>                
>> class="org.apache.activemq.pool.PooledConnectionFactory">
>> >>                 <property name="connectionFactory">
>> >>                         <bean
>> >>
>> >> class="org.apache.activemq.ActiveMQConnectionFactory">
>> >>                                  <property name="brokerURL"
>> >>
>> >> value="tcp://192.168.1.102:61616"/>
>> >>                         </bean>
>> >>                 </property>
>> >>         </bean>
>> >>
>> >>         <bean name="twoBrokersTestQueueListener"
>> >>                
>> class="activemqTest.twoBrokers.TwoBrokersTestListener">
>> >>         </bean>
>> >>
>> >>         <bean id="twoBrokersTestQueueListenerContainer"
>> >>
>> >>
>> class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>> >>                 <property name="concurrentConsumers" value="5" />
>> >>                 <property name="connectionFactory"
>> >> ref="twoBrokersTestJmsFactory" />
>> >>                 <property name="destinationName"
>> >> value="ActiveMQ.In.twoBrokersTest" />
>> >>                 <property name="messageListener"
>> >> ref="twoBrokersTestQueueListener" />
>> >>                 <property name="sessionAcknowledgeModeName"
>> >>                         value="CLIENT_ACKNOWLEDGE" />
>> >>                 <property name="sessionTransacted" value="true" />
>> >>         </bean>
>> >>
>> >>
>> >> To made it work more reliable, i tried to use JDBC Master/Slave
>> cluster.
>> >> I
>> >> changed the brokerURL to:
>> >>
>> >>
>> >>         failover:(tcp://192.168.1.102:61616,tcp://192.168.1.236:61616)
>> >>
>> >> And start two brokers in different PC. I configurate both of the
>> >> activemq.xml to use the jdbcPersistenceAdapter, like below:
>> >>
>> >>         <persistenceAdapter>
>> >>                 <jdbcPersistenceAdapter dataSource="#mssql-ds"
>> >> useDatabaseLock="false"/>
>> >>         </persistenceAdapter>
>> >>
>> >> The DB I used is SQLServer 2000. So I have to set useDatabaseLock to
>> >> false
>> >> or else there will be an exception.
>> >>
>> >>
>> >> Then I sent some messages to queue with an interval. the problem is
>> some
>> >> of
>> >> the messages would not be consumed by the
>> >> messageListenr(twoBrokersTestQueueListener) if the interval is more
>> than
>> >> 30
>> >> seconds. That is to say, it work fine if i sent the messages every 20
>> (or
>> >> any interval <= 29) seconds.
>> >>
>> >>
>> >> The only related constant I konw whose default value is set to 30
>> seconds
>> >> is
>> >> "MaxInactivityDuration". I have tried to configurate
>> >> "wireFormat.maxInactivityDuration=0" in both client and broker to
>> disable
>> >> it. However, I didn't work.
>> >>
>> >> It is very strange that "interval" makes the listeners not working as
>> >> expected.
>> >>
>> >> Any help/suggestions would be appreciated
>> >>
>> >> Thank you in advance,
>> >>
>> >> Dave
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Messages-are-blocked-in-queue-when-using-JDBC-Master-Slave-tp14334149s2354p14334149.html
>> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Regards,
>> > Hiram
>> >
>> > Blog: http://hiramchirino.com
>> >
>> > Open Source SOA
>> > http://open.iona.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Messages-are-blocked-in-queue-when-using-JDBC-Master-Slave-tp14334149s2354p14349755.html
>>
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Regards,
> Hiram
> 
> Blog: http://hiramchirino.com
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-are-blocked-in-queue-when-using-JDBC-Master-Slave-tp14334149s2354p14357366.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message