From 6a2ffca57e72a92fa90eed578d9be15be59686a3 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Tue, 5 May 2015 19:04:44 -0400 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-5699 Use constant symbols that are now available in v0.9+ of proton-j --- .../activemq/transport/amqp/client/AmqpReceiver.java | 12 +++--------- .../activemq/transport/amqp/client/AmqpSender.java | 5 +---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java index 978075c44c..049fe4d1bf 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpReceiver.java @@ -38,6 +38,7 @@ import org.apache.qpid.proton.amqp.DescribedType; import org.apache.qpid.proton.amqp.Symbol; import org.apache.qpid.proton.amqp.messaging.Accepted; import org.apache.qpid.proton.amqp.messaging.Modified; +import org.apache.qpid.proton.amqp.messaging.Rejected; import org.apache.qpid.proton.amqp.messaging.Released; import org.apache.qpid.proton.amqp.messaging.Source; import org.apache.qpid.proton.amqp.messaging.Target; @@ -58,14 +59,7 @@ public class AmqpReceiver extends AmqpAbstractResource { private static final Logger LOG = LoggerFactory.getLogger(AmqpReceiver.class); - // TODO: Use constants available from Proton 0.9 - private static final Symbol ACCEPTED_DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:accepted:list"); - private static final Symbol REJECTED_DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:rejected:list"); - private static final Symbol MODIFIED_DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:modified:list"); - private static final Symbol RELEASED_DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:released:list"); - private final AtomicBoolean closed = new AtomicBoolean(); - private final BlockingQueue prefetch = new LinkedBlockingDeque(); private final AmqpSession session; @@ -534,8 +528,8 @@ public class AmqpReceiver extends AmqpAbstractResource { protected void configureSource(Source source) { Map filters = new HashMap(); - Symbol[] outcomes = new Symbol[]{ACCEPTED_DESCRIPTOR_SYMBOL, REJECTED_DESCRIPTOR_SYMBOL, - RELEASED_DESCRIPTOR_SYMBOL, MODIFIED_DESCRIPTOR_SYMBOL}; + Symbol[] outcomes = new Symbol[]{Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, + Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL}; if (getSubscriptionName() != null && !getSubscriptionName().isEmpty()) { source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpSender.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpSender.java index e8e5c8b312..303c7b2284 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpSender.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpSender.java @@ -52,9 +52,6 @@ public class AmqpSender extends AmqpAbstractResource { private static final Logger LOG = LoggerFactory.getLogger(AmqpSender.class); private static final byte[] EMPTY_BYTE_ARRAY = new byte[] {}; - //TODO: Use constants available from Proton 0.9 - private static final Symbol ACCEPTED_DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:accepted:list"); - private static final Symbol REJECTED_DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:rejected:list"); public static final long DEFAULT_SEND_TIMEOUT = 15000; @@ -240,7 +237,7 @@ public class AmqpSender extends AmqpAbstractResource { @Override protected void doOpen() { - Symbol[] outcomes = new Symbol[]{ACCEPTED_DESCRIPTOR_SYMBOL, REJECTED_DESCRIPTOR_SYMBOL}; + Symbol[] outcomes = new Symbol[]{ Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL }; Source source = new Source(); source.setAddress(senderId); source.setOutcomes(outcomes);