You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2007/09/28 11:55:14 UTC
svn commit: r580277 - in /incubator/qpid/branches/M2: ./
java/client/src/main/java/org/apache/qpid/client/
java/client/src/main/java/org/apache/qpid/client/protocol/
java/client/src/test/java/org/apache/qpid/test/unit/client/connection/
java/perftests/...
Author: ritchiem
Date: Fri Sep 28 02:55:13 2007
New Revision: 580277
URL: http://svn.apache.org/viewvc?rev=580277&view=rev
Log:
Merged revisions 573740-574504 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1
........
r573740 | rgreig | 2007-09-07 23:41:10 +0100 (Fri, 07 Sep 2007) | 3 lines
QPID-583 Added old topic test which had been removed in the past.
........
r574078 | rgreig | 2007-09-09 22:16:32 +0100 (Sun, 09 Sep 2007) | 1 line
QPID-582 Fixing the scripts to run the old topic test
........
r574237 | ritchiem | 2007-09-10 14:08:36 +0100 (Mon, 10 Sep 2007) | 1 line
QPID-585 : Created a new StateManager for each subsequent makeBrokerConnection call during the initial connection.
........
r574266 | ritchiem | 2007-09-10 15:46:04 +0100 (Mon, 10 Sep 2007) | 1 line
QPID-584 : Client exceptions are now presented via any set Exception Listener
........
r574504 | rgreig | 2007-09-11 09:10:26 +0100 (Tue, 11 Sep 2007) | 1 line
QPID-582 Fixing build on Java 6
........
Added:
incubator/qpid/branches/M2/java/perftests/bin/
- copied from r574504, incubator/qpid/branches/M2.1/java/perftests/bin/
incubator/qpid/branches/M2/java/perftests/bin/run_many.sh
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/bin/run_many.sh
incubator/qpid/branches/M2/java/perftests/bin/topicListener.sh
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/bin/topicListener.sh
incubator/qpid/branches/M2/java/perftests/bin/topicPublisher.sh
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/bin/topicPublisher.sh
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/oldtopic/
- copied from r574504, incubator/qpid/branches/M2.1/java/perftests/src/main/java/org/apache/qpid/oldtopic/
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java
incubator/qpid/branches/M2/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java
- copied unchanged from r574504, incubator/qpid/branches/M2.1/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java
Modified:
incubator/qpid/branches/M2/ (props changed)
incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
incubator/qpid/branches/M2/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
Propchange: incubator/qpid/branches/M2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Sep 28 02:55:13 2007
@@ -1 +1 @@
-/incubator/qpid/branches/M2.1:400000-567005,568919,568924,573502,573516,574874,574902,575738,575788,575811,577941,578058,578845
+/incubator/qpid/branches/M2.1:400000-567005,568919,568924,573502,573516,573740-574504,574874,574902,575738,575788,575811,577941,578058,578845
Modified: incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java?rev=580277&r1=580276&r2=580277&view=diff
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java (original)
+++ incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java Fri Sep 28 02:55:13 2007
@@ -29,6 +29,7 @@
import org.apache.qpid.client.failover.FailoverRetrySupport;
import org.apache.qpid.client.protocol.AMQProtocolHandler;
import org.apache.qpid.client.state.AMQState;
+import org.apache.qpid.client.state.AMQStateManager;
import org.apache.qpid.client.transport.TransportConnection;
import org.apache.qpid.exchange.ExchangeDefaults;
import org.apache.qpid.framing.AMQShortString;
@@ -296,6 +297,11 @@
{
lastException = e;
+ //We need to change protocol handler here as an error during the connect will not
+ // cause the StateManager to be replaced. So the state is out of sync on reconnect
+ // This can be seen when a exception occurs during connection. i.e. log4j NoSuchMethod. (using < 1.2.12)
+ _protocolHandler.setStateManager(new AMQStateManager());
+
if (_logger.isInfoEnabled())
{
_logger.info("Unable to connect to broker at " + _failoverPolicy.getCurrentBrokerDetails(),
@@ -1127,6 +1133,10 @@
if (_exceptionListener != null)
{
_exceptionListener.onException(je);
+ }
+ else
+ {
+ _logger.error("Throwable Received but no listener set: " + cause.getMessage());
}
if (!(cause instanceof AMQUndeliveredException) && !(cause instanceof AMQAuthenticationException))
Modified: incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java?rev=580277&r1=580276&r2=580277&view=diff
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java (original)
+++ incubator/qpid/branches/M2/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java Fri Sep 28 02:55:13 2007
@@ -24,6 +24,7 @@
import org.apache.mina.common.IoHandlerAdapter;
import org.apache.mina.common.IoSession;
import org.apache.mina.filter.SSLFilter;
+import org.apache.mina.filter.codec.ProtocolCodecException;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.qpid.AMQConnectionClosedException;
@@ -336,6 +337,20 @@
sessionClosed(session);
}
+ else
+ {
+
+ if (cause instanceof ProtocolCodecException)
+ {
+ _logger.info("Protocol Exception caught NOT going to attempt failover as " +
+ "cause isn't AMQConnectionClosedException: " + cause, cause);
+
+ AMQException amqe = new AMQException("Protocol handler error: " + cause, cause);
+ propagateExceptionToWaiters(amqe);
+ }
+
+ _connection.exceptionReceived(cause);
+ }
// FIXME Need to correctly handle other exceptions. Things like ...
// if (cause instanceof AMQChannelClosedException)
@@ -684,7 +699,10 @@
public void setStateManager(AMQStateManager stateManager)
{
_stateManager = stateManager;
- _protocolSession.setStateManager(stateManager);
+ if (_protocolSession != null)
+ {
+ _protocolSession.setStateManager(stateManager);
+ }
}
public AMQProtocolSession getProtocolSession()
Modified: incubator/qpid/branches/M2/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java?rev=580277&r1=580276&r2=580277&view=diff
==============================================================================
--- incubator/qpid/branches/M2/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java (original)
+++ incubator/qpid/branches/M2/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java Fri Sep 28 02:55:13 2007
@@ -96,7 +96,7 @@
// should really not be called before _connection start
assertTrue("There should not be messages waiting for the consumer", _consumer.receiveNoWait() == null);
_connection.start();
- assertTrue("There should be messages waiting for the consumer", _consumer.receiveNoWait() == null);
+ assertTrue("There should be messages waiting for the consumer", _consumer.receive(1000) == null);
assertTrue("Connection should be started", _connection.started());
}