Repository: activemq Updated Branches: refs/heads/master c8af70f09 -> 9c8bd3360
https://issues.apache.org/jira/browse/AMQ-6222 Reverting the change to move clearMarshalledState into the callback listener as beforeMarshall is now called before the async message add Revert 75990ef14a092b629bf8d2127bc4786e51b31684 Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/9c8bd336 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/9c8bd336 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/9c8bd336 Branch: refs/heads/master Commit: 9c8bd3360faf89c8fb054b02040458027782f48f Parents: c8af70f Author: Christopher L. Shannon (cshannon) <[email protected]> Authored: Mon Apr 18 11:49:16 2016 +0000 Committer: Christopher L. Shannon (cshannon) <[email protected]> Committed: Mon Apr 18 11:49:16 2016 +0000 ---------------------------------------------------------------------- .../apache/activemq/broker/region/Queue.java | 22 ++++---------------- 1 file changed, 4 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/9c8bd336/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java index 9578c7d..a2f7184 100755 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java @@ -840,26 +840,12 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index if (messages.isCacheEnabled() && !isPersistJMSRedelivered()) { message.beforeMarshall(null); result = store.asyncAddQueueMessage(context, message, isOptimizeStorage()); - final PendingMarshalUsageTracker tracker = new PendingMarshalUsageTracker(message); - result.addListener(new Runnable() { - @Override - public void run() { - //Execute usage tracker and then check isReduceMemoryFootprint() - tracker.run(); - if (isReduceMemoryFootprint()) { - try { - message.clearMarshalledState(); - } catch (JMSException e) { - throw new IllegalStateException(e); - } - } - } - }); + result.addListener(new PendingMarshalUsageTracker(message)); } else { store.addMessage(context, message); - if (isReduceMemoryFootprint()) { - message.clearMarshalledState(); - } + } + if (isReduceMemoryFootprint()) { + message.clearMarshalledState(); } } catch (Exception e) { // we may have a store in inconsistent state, so reset the cursor
