Repository: activemq Updated Branches: refs/heads/trunk 78cb1120b -> e90f1decb
https://issues.apache.org/jira/browse/AMQ-5391 Fix temp queue creation. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/e90f1dec Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/e90f1dec Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/e90f1dec Branch: refs/heads/trunk Commit: e90f1decb2bac727378b4754b101fa9f79faeed4 Parents: 78cb112 Author: Timothy Bish <[email protected]> Authored: Wed Oct 15 10:35:36 2014 -0400 Committer: Timothy Bish <[email protected]> Committed: Wed Oct 15 10:35:36 2014 -0400 ---------------------------------------------------------------------- .../transport/amqp/AmqpProtocolConverter.java | 28 ++++++++------------ 1 file changed, 11 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/e90f1dec/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 472aeb9..f4df997 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 @@ -392,8 +392,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { if (rh != null) { rh.onResponse(this, response); } else { - // Pass down any unexpected errors. Should this close the - // connection? + // Pass down any unexpected errors. Should this close the connection? if (response.isException()) { Throwable exception = ((ExceptionResponse) response).getException(); handleException(exception); @@ -415,8 +414,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { } } } else if (command.getDataStructureType() == ConnectionError.DATA_STRUCTURE_TYPE) { - // Pass down any unexpected async errors. Should this close the - // connection? + // Pass down any unexpected async errors. Should this close the connection? Throwable exception = ((ConnectionError) command).getException(); handleException(exception); } else if (command.isBrokerInfo()) { @@ -623,9 +621,8 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { } message.setProducerId(producerId); - // Always override the AMQP client's MessageId with our own. - // Preserve the - // original in the TextView property for later Ack. + // Always override the AMQP client's MessageId with our own. Preserve + // the original in the TextView property for later Ack. MessageId messageId = new MessageId(producerId, messageIdGenerator.getNextSequenceId()); MessageId amqpMessageId = message.getMessageId(); @@ -648,11 +645,9 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { message.setTransactionId(new LocalTransactionId(connectionId, txid)); } - // Lets handle the case where the expiration was set, but the - // timestamp - // was not set by the client. Lets assign the timestamp now, and - // adjust the - // expiration. + // Lets handle the case where the expiration was set, but the timestamp + // was not set by the client. Lets assign the timestamp now, and adjust + // the expiration. if (message.getExpiration() != 0) { if (message.getTimestamp() == 0) { message.setTimestamp(System.currentTimeMillis()); @@ -840,8 +835,9 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { ProducerId producerId = new ProducerId(sessionContext.sessionId, sessionContext.nextProducerId++); ActiveMQDestination dest = null; boolean anonymous = false; + String targetNodeName = target.getAddress(); - if (target.getAddress().equals(amqpTransport.getWireFormat().getAnonymousNodeName())) { + if (targetNodeName != null && targetNodeName.equals(amqpTransport.getWireFormat().getAnonymousNodeName())) { anonymous = true; } else if (target.getDynamic()) { dest = createTempQueue(); @@ -1014,10 +1010,8 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter { ActiveMQMessage temp = null; if (md.getMessage() != null) { - // Topics can dispatch the same Message to more than one - // consumer - // so we must copy to prevent concurrent read / write to - // the same + // Topics can dispatch the same Message to more than one consumer + // so we must copy to prevent concurrent read / write to the same // message object. if (md.getDestination().isTopic()) { synchronized (md.getMessage()) {
