mirror of https://github.com/apache/activemq.git
Moving beforeMarshall call out of the store and into the actual
destination
(cherry picked from commit b9b98a45ce
)
This commit is contained in:
parent
dc3c5a719b
commit
32913408a6
|
@ -840,6 +840,7 @@ public class Queue extends BaseDestination implements Task, UsageListener, Index
|
|||
//condition if the original add is processed after the update, which can cause
|
||||
//a duplicate message to be stored
|
||||
if (messages.isCacheEnabled() && !isPersistJMSRedelivered()) {
|
||||
message.beforeMarshall(null);
|
||||
result = store.asyncAddQueueMessage(context, message, isOptimizeStorage());
|
||||
final PendingMarshalUsageTracker tracker = new PendingMarshalUsageTracker(message);
|
||||
result.addListener(new Runnable() {
|
||||
|
|
|
@ -511,6 +511,7 @@ public class Topic extends BaseDestination implements Task {
|
|||
|
||||
waitForSpace(context,producerExchange, systemUsage.getStoreUsage(), getStoreUsageHighWaterMark(), logMessage);
|
||||
}
|
||||
message.beforeMarshall(null);
|
||||
result = topicStore.asyncAddTopicMessage(context, message,isOptimizeStorage());
|
||||
}
|
||||
|
||||
|
|
|
@ -384,7 +384,6 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
|
|||
public ListenableFuture<Object> asyncAddQueueMessage(final ConnectionContext context, final Message message)
|
||||
throws IOException {
|
||||
if (isConcurrentStoreAndDispatchQueues()) {
|
||||
message.beforeMarshall(wireFormat);
|
||||
StoreQueueTask result = new StoreQueueTask(this, context, message);
|
||||
ListenableFuture<Object> future = result.getFuture();
|
||||
message.getMessageId().setFutureOrSequenceLong(future);
|
||||
|
@ -753,7 +752,6 @@ public class KahaDBStore extends MessageDatabase implements PersistenceAdapter {
|
|||
public ListenableFuture<Object> asyncAddTopicMessage(final ConnectionContext context, final Message message)
|
||||
throws IOException {
|
||||
if (isConcurrentStoreAndDispatchTopics()) {
|
||||
message.beforeMarshall(wireFormat);
|
||||
StoreTopicTask result = new StoreTopicTask(this, context, message, subscriptionCount.get());
|
||||
result.aquireLocks();
|
||||
addTopicTask(this, result);
|
||||
|
|
|
@ -754,7 +754,6 @@ class LevelDBStore extends LockableServiceSupport with BrokerServiceAware with P
|
|||
|
||||
def doAdd(uow: DelayableUOW, context: ConnectionContext, message: Message, delay:Boolean): CountDownFuture[AnyRef] = {
|
||||
check_running
|
||||
message.beforeMarshall(wireFormat);
|
||||
message.incrementReferenceCount()
|
||||
uow.addCompleteListener({
|
||||
message.decrementReferenceCount()
|
||||
|
|
Loading…
Reference in New Issue