activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1412127 - in /activemq/trunk: activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java activemq-client/src/main/java/org/apache/activemq/filter/NoLocalExpression.java
Date Wed, 21 Nov 2012 14:33:59 GMT
Author: chirino
Date: Wed Nov 21 14:33:58 2012
New Revision: 1412127

URL: http://svn.apache.org/viewvc?rev=1412127&view=rev
Log:
Support the no-local option over AMQP.

Modified:
    activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
    activemq/trunk/activemq-client/src/main/java/org/apache/activemq/filter/NoLocalExpression.java

Modified: activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java?rev=1412127&r1=1412126&r2=1412127&view=diff
==============================================================================
--- activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
(original)
+++ activemq/trunk/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
Wed Nov 21 14:33:58 2012
@@ -59,6 +59,7 @@ class AmqpProtocolConverter {
     private final AmqpTransport amqpTransport;
     private static final Symbol COPY = Symbol.getSymbol("copy");
     private static final Symbol JMS_SELECTOR = Symbol.valueOf("jms-selector");
+    private static final Symbol NO_LOCAL = Symbol.valueOf("no-local");
 
     public AmqpProtocolConverter(AmqpTransport amqpTransport, BrokerContext brokerContext)
{
         this.amqpTransport = amqpTransport;
@@ -909,6 +910,10 @@ class AmqpProtocolConverter {
             if( value!=null ) {
                 consumerInfo.setSelector(value.getDescribed().toString());
             }
+            value = (DescribedType)filter.get(NO_LOCAL);
+            if( value!=null ) {
+                consumerInfo.setNoLocal(true);
+            }
         }
 
         sendToActiveMQ(consumerInfo, new ResponseHandler() {

Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/filter/NoLocalExpression.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/filter/NoLocalExpression.java?rev=1412127&r1=1412126&r2=1412127&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/filter/NoLocalExpression.java
(original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/filter/NoLocalExpression.java
Wed Nov 21 14:33:58 2012
@@ -35,7 +35,8 @@ public class NoLocalExpression implement
             if (message.isDropped()) {
                 return false;
             }
-            return !connectionId.equals(message.getMessage().getMessageId().getProducerId().getConnectionId());
+            String messageConnectionId = message.getMessage().getProducerId().getConnectionId();
+            return !connectionId.equals(messageConnectionId);
         } catch (IOException e) {
             throw JMSExceptionSupport.create(e);
         }



Mime
View raw message