mirror of https://github.com/apache/activemq.git
Reverting the change to move clearMarshalledState into the callback
listener as beforeMarshall is now called before the async message add
Revert 75990ef14a
This commit is contained in:
parent
c8af70f094
commit
9c8bd3360f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue