Repository: qpid-jms Updated Branches: refs/heads/master 86b678e83 -> 99441c0f5
QPIDJMS-319 remove unneeded buffer duplicate on inbound messages Stop duplicating the message bytes buffer for message decodes. Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/99441c0f Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/99441c0f Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/99441c0f Branch: refs/heads/master Commit: 99441c0f500b00effd99197792c00f80c1991e05 Parents: 86b678e Author: Timothy Bish <tabish...@gmail.com> Authored: Tue Aug 29 15:04:55 2017 -0400 Committer: Timothy Bish <tabish...@gmail.com> Committed: Tue Aug 29 15:04:55 2017 -0400 ---------------------------------------------------------------------- .../org/apache/qpid/jms/provider/amqp/AmqpConsumer.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/99441c0f/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java index b5194cf..6c7b7e2 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpConsumer.java @@ -346,7 +346,7 @@ public class AmqpConsumer extends AmqpAbstractResource<JmsConsumerInfo, Receiver int prefetchedMessageCount = getResourceInfo().getPrefetchedMessageCount(); int potentialPrefetch = currentCredit + prefetchedMessageCount; - if(potentialPrefetch <= prefetchSize * 0.7) { + if (potentialPrefetch <= prefetchSize * 0.7) { int additionalCredit = prefetchSize - currentCredit - prefetchedMessageCount; LOG.trace("Consumer {} granting additional credit: {}", getConsumerId(), additionalCredit); @@ -501,6 +501,8 @@ public class AmqpConsumer extends AmqpAbstractResource<JmsConsumerInfo, Receiver // a bytes messages as a fall back. settleDelivery(incoming, MODIFIED_FAILED_UNDELIVERABLE); return false; + } finally { + incomingBuffer.clear(); } try { @@ -604,11 +606,7 @@ public class AmqpConsumer extends AmqpAbstractResource<JmsConsumerInfo, Receiver } } - try { - return incomingBuffer.duplicate(); - } finally { - incomingBuffer.clear(); - } + return incomingBuffer; } public void preCommit() { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org