You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/02/25 16:17:48 UTC
activemq git commit: https://issues.apache.org/jira/browse/AMQ-5615
Repository: activemq
Updated Branches:
refs/heads/master 0142c4dc8 -> f988ca6e4
https://issues.apache.org/jira/browse/AMQ-5615
reorganize the connection response code to only pump once all state is
process.
Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f988ca6e
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f988ca6e
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f988ca6e
Branch: refs/heads/master
Commit: f988ca6e49851120fb0f89203637a24bd9b4fa47
Parents: 0142c4d
Author: Timothy Bish <ta...@gmail.com>
Authored: Wed Feb 25 10:17:06 2015 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Wed Feb 25 10:17:40 2015 -0500
----------------------------------------------------------------------
.../transport/amqp/AmqpProtocolConverter.java | 32 +++++++++++---------
1 file changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq/blob/f988ca6e/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
index 16bfa3d..87fa7df 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
@@ -530,24 +530,28 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
sendToActiveMQ(connectionInfo, new ResponseHandler() {
@Override
public void onResponse(IAmqpProtocolConverter converter, Response response) throws IOException {
- protonConnection.open();
- pumpProtonToSocket();
+ Throwable exception = null;
+ try {
+ protonConnection.open();
- if (response.isException()) {
- Throwable exception = ((ExceptionResponse) response).getException();
- if (exception instanceof SecurityException) {
- protonConnection.setCondition(new ErrorCondition(AmqpError.UNAUTHORIZED_ACCESS, exception.getMessage()));
- } else if (exception instanceof InvalidClientIDException) {
- protonConnection.setCondition(new ErrorCondition(AmqpError.INVALID_FIELD, exception.getMessage()));
- } else {
- protonConnection.setCondition(new ErrorCondition(AmqpError.ILLEGAL_STATE, exception.getMessage()));
+ if (response.isException()) {
+ exception = ((ExceptionResponse) response).getException();
+ if (exception instanceof SecurityException) {
+ protonConnection.setCondition(new ErrorCondition(AmqpError.UNAUTHORIZED_ACCESS, exception.getMessage()));
+ } else if (exception instanceof InvalidClientIDException) {
+ protonConnection.setCondition(new ErrorCondition(AmqpError.INVALID_FIELD, exception.getMessage()));
+ } else {
+ protonConnection.setCondition(new ErrorCondition(AmqpError.ILLEGAL_STATE, exception.getMessage()));
+ }
+ protonConnection.close();
}
- protonConnection.close();
+ } finally {
pumpProtonToSocket();
- amqpTransport.onException(IOExceptionSupport.create(exception));
- return;
- }
+ if (response.isException()) {
+ amqpTransport.onException(IOExceptionSupport.create(exception));
+ }
+ }
}
});
}