Support the no-local option over AMQP.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1412127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2012-11-21 14:33:58 +00:00
parent d350ce6f61
commit 2727496c00
2 changed files with 7 additions and 1 deletions

View File

@ -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() {

View File

@ -35,7 +35,8 @@ public class NoLocalExpression implements BooleanExpression {
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);
}