[ 
https://issues.apache.org/activemq/browse/AMQ-1710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45367#action_45367
 ] 

Vadim Katz commented on AMQ-1710:
---------------------------------

Thank you for suggesting a patch, Mario.
I have applied it but received the following exception in the slave broker
{code}
008-09-03 14:49:58,835 [/127.0.0.1:4038] ERROR Service                        - 
Async error occurred: javax.jms.JMSException: Could not correlate 
acknowledgment with dispatched message: MessageAck {commandId = 3709, 
responseRequired = false, ackType = 0, consumerId = 
ID:VKATZ-XP1-3975-1220478455256-0:0:4:1, firstMessageId = null, lastMessageId = 
ID:VKATZ-XP1-3975-1220478455256-0:0:26:1:10, destination = 
queue://convert.input, transactionId = 
TX:ID:VKATZ-XP1-3975-1220478455256-0:0:10, messageCount = 1}
javax.jms.JMSException: Could not correlate acknowledgment with dispatched 
message: MessageAck {commandId = 3709, responseRequired = false, ackType = 0, 
consumerId = ID:VKATZ-XP1-3975-1220478455256-0:0:4:1, firstMessageId = null, 
lastMessageId = ID:VKATZ-XP1-3975-1220478455256-0:0:26:1:10, destination = 
queue://convert.input, transactionId = 
TX:ID:VKATZ-XP1-3975-1220478455256-0:0:10, messageCount = 1}
        at 
org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:279)
        at 
org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:364)
        at 
org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:470)
        at 
org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:194)
        at 
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:73)
        at 
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:73)
        at 
org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:84)
        at 
org.apache.activemq.broker.TransportConnection.processMessageAck(TransportConnection.java:443)
        at org.apache.activemq.command.MessageAck.visit(MessageAck.java:196)
        at 
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
        at 
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:180)
        at 
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at 
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:143)
        at 
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:206)
        at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at 
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:196)
        at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
        at java.lang.Thread.run(Thread.java:619)

I've tested it with amq-5.1.0 and spring-2.5.5 with locally transacted session. 
Also, even though the slave broker becomes active it hangs after throwing the 
exception and stops accepting new connections.

thanks,
vadim
{code}

> Failing over in JDBC Master/Slave topology does not preserve transaction state
> ------------------------------------------------------------------------------
>
>                 Key: AMQ-1710
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1710
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Transport
>    Affects Versions: 4.1.2
>         Environment: Tested on 4.1.1 and 4.1.2
>            Reporter: Rob Bugh
>         Attachments: AMQ-1710.patch, FailoverTest.java
>
>
> Recreate steps:
> 1) Start two brokers in JDBC Master/Slave topology
> 2) Create an app that puts two or more messages in a queue (two messages are 
> sufficient). Give each message a JMXGroupID to force them to go to the same 
> consumer.
> 3) Create another app that creates two connection to the broker and on each 
> connection creates a session and a consumer with a unique clientID. Each 
> should attempt to consume messages from the queue defined above.
> 4) Run the app and when the first message is consumed stop the master. 
> Failover will occur and the slave becomes the new master.
> 5) Notice that when the transport resumes in the client that received the 
> first message an exception like the following is thrown:
>      javax.jms.JMSException: Transaction 
> 'TX:ID:HOSTNAME-3289-1210016021661-0:1:1' has not been started.
> 6) Notice that the second consumer now recieves both messages.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to