Author: ritchiem
Date: Tue Nov 6 03:12:06 2007
New Revision: 592373
URL: http://svn.apache.org/viewvc?rev=592373&view=rev
Log:
QPID-663 Messages fail to be received after fail over. This is due to the old
protocol session being reinstated after fail over. The new protocol session
needs to be set in the StateManager as this maintains its own reference which
is not being updated hence messages are being lost.
Modified:
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
Modified:
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java?rev=592373&r1=592372&r2=592373&view=diff
==============================================================================
---
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
(original)
+++
incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
Tue Nov 6 03:12:06 2007
@@ -48,10 +48,10 @@
* <ol>
* <li>Sets the failing over condition to true.</li>
* <li>Creates a [EMAIL PROTECTED] FailoverException} and gets the protocol
connection handler to propagate this event to all
- * interested parties.</li>
+ * interested parties.</li>
* <li>Takes the failover mutex on the protocol connection handler.</li>
* <li>Abandons the fail over if any of the interested parties vetoes it. The
mutex is released and the condition
- * reset.</li>
+ * reset.</li>
* <li>Creates a new [EMAIL PROTECTED] AMQStateManager} and re-established the
connection through it.</li>
* <li>Informs the AMQConnection if the connection cannot be
re-established.</li>
* <li>Recreates all sessions from the old connection to the new.</li>
@@ -64,17 +64,14 @@
* </table>
*
* @todo The failover latch and mutex are used like a lock and condition. If
the retrotranlator supports lock/condition
- * then could change over to using them. 1.4 support still needed.
- *
+ * then could change over to using them. 1.4 support still needed.
* @todo If the condition is set to null on a vetoes fail-over and there are
already other threads waiting on the
- * condition, they will never be released. It might be an idea to reset
the condition in a finally block.
- *
+ * condition, they will never be released. It might be an idea to reset the
condition in a finally block.
* @todo Creates a [EMAIL PROTECTED] AMQDisconnectedException} and passes it
to the AMQConnection. No need to use an
- * exception-as-argument here, could just as easily call a specific
method for this purpose on AMQConnection.
- *
+ * exception-as-argument here, could just as easily call a specific method for
this purpose on AMQConnection.
* @todo Creates a [EMAIL PROTECTED] FailoverException} and propagates it to
the MethodHandlers. No need to use an
- * exception-as-argument here, could just as easily call a specific
method for this purpose on
- * [EMAIL PROTECTED] org.apache.qpid.protocol.AMQMethodListener}.
+ * exception-as-argument here, could just as easily call a specific method for
this purpose on
+ * [EMAIL PROTECTED] org.apache.qpid.protocol.AMQMethodListener}.
*/
public class FailoverHandler implements Runnable
{
@@ -182,6 +179,7 @@
}
else
{
+
existingStateManager.setProtocolSession(_amqProtocolHandler.getProtocolSession());
_amqProtocolHandler.setStateManager(existingStateManager);
try
{