You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by cmose <cj...@gmail.com> on 2006/08/09 23:26:50 UTC

MasterSlave failover question

I'm trying to fiddle around with the master slave configuration in 4.01 using
a few simplistic test jms sender and receiver files. Basically I'm running 2
instances of activemq on my pc and have one configured as a master and one
configured as a slave. Both instances load up, and I see the correct logging
information in the command window regarding attachment of a slave and if the
master is shutdown, the slave shows that it apes the state of the master
prior to the shutdown and etc.,

The trouble is that my test receiver program that just sits there consuming
messages dies if the master broker is shutdown (even if the slave broker is
still up and running). If i restart the test receiver program it will
connect to the slave and run just fine however, I was under the impression
that it was meant to just keep plugging along if the master broker went down
(no exception is thrown or anything of that nature that I could trap and
attempt to initiate a reconnect).

Any advice (or requests for additional information to be able to provide
advice)?

- I'm using the following connection string (using a jndi.properties file):
failover://(tcp://localhost:61616,tcp://localhost:61617)?randomize=false
-- 
View this message in context: http://www.nabble.com/MasterSlave-failover-question-tf2081356.html#a5734206
Sent from the ActiveMQ - User forum at Nabble.com.


Re: MasterSlave failover question

Posted by cmose <cj...@gmail.com>.
Hmnn...well I get a ton of errors trying to run the 8/10 snapshot, a bunch of
spring BeanCreationException errors. Unfortunately I have to leave for work
soon and it will be extremely difficult to download the snapshot and run it.
If someone cares to give it a whack with my crappy little test code, I've
uploaded it (crappy test code warning, no javadoc, poorly written, yadda
yadda yadda).

http://www.nabble.com/user-files/253/TestWaiting.java TestWaiting.java 
http://www.nabble.com/user-files/254/TestSender.java TestSender.java 
http://www.nabble.com/user-files/255/TestReceiver.java TestReceiver.java 
http://www.nabble.com/user-files/256/Runner.java Runner.java 
http://www.nabble.com/user-files/257/jndi.properties jndi.properties 


rajdavies wrote:
> 
> this is most odd - but it looks like its all related - could you try  
> the latest snapshot from here:
> 
> http://people.apache.org/maven-snapshot-repository/org/apache/ 
> activemq/apache-activemq/
> 
> cheers,
> 
> Rob
> 
> Rob Davies
> http://rajdavies.blogspot.com/
> 
> On 9 Aug 2006, at 23:53, cmose wrote:
> 
>>
>> This just gets more and more strange (to me at least): My little  
>> test sender
>> sends out 10 text messages, 0-9; my test receiver just consumes  
>> every text
>> message and prints out the text.
>> Here's what I get after running my test sender once (e.g., 10  
>> messages on
>> the queue, 0-9) and then running my test receiver:
>> Text Message 0
>> Text Message 1
>> Text Message 2
>> Text Message 3
>> Text Message 4
>> Text Message 5
>> Text Message 5
>> Text Message 6
>> Text Message 7
>> Text Message 8
>> Text Message 9
>> It looks like, in this case, one message is being redelivered? Is  
>> there some
>> configuration that I'm missing or is this just a situation likely  
>> to be
>> encountered when running the master slave configuration...?? (sure  
>> hope
>> not).
>> -- 
>> View this message in context: http://www.nabble.com/MasterSlave- 
>> failover-question-tf2081356.html#a5735343
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/MasterSlave-failover-question-tf2081356.html#a5742005
Sent from the ActiveMQ - User forum at Nabble.com.


Re: MasterSlave failover question

Posted by Rob Davies <ra...@gmail.com>.
this is most odd - but it looks like its all related - could you try  
the latest snapshot from here:

http://people.apache.org/maven-snapshot-repository/org/apache/ 
activemq/apache-activemq/

cheers,

Rob

Rob Davies
http://rajdavies.blogspot.com/

On 9 Aug 2006, at 23:53, cmose wrote:

>
> This just gets more and more strange (to me at least): My little  
> test sender
> sends out 10 text messages, 0-9; my test receiver just consumes  
> every text
> message and prints out the text.
> Here's what I get after running my test sender once (e.g., 10  
> messages on
> the queue, 0-9) and then running my test receiver:
> Text Message 0
> Text Message 1
> Text Message 2
> Text Message 3
> Text Message 4
> Text Message 5
> Text Message 5
> Text Message 6
> Text Message 7
> Text Message 8
> Text Message 9
> It looks like, in this case, one message is being redelivered? Is  
> there some
> configuration that I'm missing or is this just a situation likely  
> to be
> encountered when running the master slave configuration...?? (sure  
> hope
> not).
> -- 
> View this message in context: http://www.nabble.com/MasterSlave- 
> failover-question-tf2081356.html#a5735343
> Sent from the ActiveMQ - User forum at Nabble.com.
>








Re: MasterSlave failover question

Posted by cmose <cj...@gmail.com>.
This just gets more and more strange (to me at least): My little test sender
sends out 10 text messages, 0-9; my test receiver just consumes every text
message and prints out the text.
Here's what I get after running my test sender once (e.g., 10 messages on
the queue, 0-9) and then running my test receiver:
Text Message 0
Text Message 1
Text Message 2
Text Message 3
Text Message 4
Text Message 5
Text Message 5
Text Message 6
Text Message 7
Text Message 8
Text Message 9
It looks like, in this case, one message is being redelivered? Is there some
configuration that I'm missing or is this just a situation likely to be
encountered when running the master slave configuration...?? (sure hope
not).
-- 
View this message in context: http://www.nabble.com/MasterSlave-failover-question-tf2081356.html#a5735343
Sent from the ActiveMQ - User forum at Nabble.com.


Re: MasterSlave failover question

Posted by cmose <cj...@gmail.com>.
sure thing,
this is what I get:

INFO  PrefetchSubscription           - Could not correlate acknowledgment
with dispatched message: MessageAck {commandId
 = 86, responseRequired = false, ackType = 2, consumerId =
ID:MOSES-1593-1155160039875-1:0:1:1, firstMessageId = null, l
astMessageId = ID:MOSES-1460-1155158156156-1:0:1:1:1, destination =
queue://MyQueue, transactionId = null, messageCount
= 1}
INFO  Service                        - Async error occurred:
javax.jms.JMSException: Invalid acknowledgment: MessageAck
{commandId = 86, responseRequired = false, ackType = 2, consumerId =
ID:MOSES-1593-1155160039875-1:0:1:1, firstMessageId
 = null, lastMessageId = ID:MOSES-1460-1155158156156-1:0:1:1:1, destination
= queue://MyQueue, transactionId = null, mes
sageCount = 1}
javax.jms.JMSException: Invalid acknowledgment: MessageAck {commandId = 86,
responseRequired = false, ackType = 2, consu
merId = ID:MOSES-1593-1155160039875-1:0:1:1, firstMessageId = null,
lastMessageId = ID:MOSES-1460-1155158156156-1:0:1:1:
1, destination = queue://MyQueue, transactionId = null, messageCount = 1}
        at
org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:181)
        at
org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:233)
        at
org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:362)
        at
org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:176)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:65)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:65)
        at
org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:78)
        at
org.apache.activemq.broker.AbstractConnection.processMessageAck(AbstractConnection.java:356)
        at org.apache.activemq.command.MessageAck.visit(MessageAck.java:178)
        at
org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:201)
        at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
        at
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
        at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
        at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
        at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
        at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
        at java.lang.Thread.run(Thread.java:595)

-- 
View this message in context: http://www.nabble.com/MasterSlave-failover-question-tf2081356.html#a5735207
Sent from the ActiveMQ - User forum at Nabble.com.


Re: MasterSlave failover question

Posted by Rob Davies <ra...@gmail.com>.
could you enable debug logging on the client that fails to fall over  
to the slave when the master dies ?

cheers,

Rob

Rob Davies
http://rajdavies.blogspot.com/


On 9 Aug 2006, at 22:26, cmose wrote:

>
> I'm trying to fiddle around with the master slave configuration in  
> 4.01 using
> a few simplistic test jms sender and receiver files. Basically I'm  
> running 2
> instances of activemq on my pc and have one configured as a master  
> and one
> configured as a slave. Both instances load up, and I see the  
> correct logging
> information in the command window regarding attachment of a slave  
> and if the
> master is shutdown, the slave shows that it apes the state of the  
> master
> prior to the shutdown and etc.,
>
> The trouble is that my test receiver program that just sits there  
> consuming
> messages dies if the master broker is shutdown (even if the slave  
> broker is
> still up and running). If i restart the test receiver program it will
> connect to the slave and run just fine however, I was under the  
> impression
> that it was meant to just keep plugging along if the master broker  
> went down
> (no exception is thrown or anything of that nature that I could  
> trap and
> attempt to initiate a reconnect).
>
> Any advice (or requests for additional information to be able to  
> provide
> advice)?
>
> - I'm using the following connection string (using a  
> jndi.properties file):
> failover://(tcp://localhost:61616,tcp://localhost:61617)? 
> randomize=false
> -- 
> View this message in context: http://www.nabble.com/MasterSlave- 
> failover-question-tf2081356.html#a5734206
> Sent from the ActiveMQ - User forum at Nabble.com.
>