diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-11-01 14:11:41 +0000 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-11-01 14:11:41 +0000 |
commit | 1a8ff3cd239fe4698cd9b65a9b6f34931857092f (patch) | |
tree | 115372a3cd98397692826ea38137602a29d53c72 | |
parent | 16ff1b064f81859283fd7b4293a6d4fb4ee4f6d6 (diff) | |
download | rabbitmq-server-1a8ff3cd239fe4698cd9b65a9b6f34931857092f.tar.gz |
only wait for disk syncs for persistent messages on durable queues
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index e78eb06f..adae926c 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -453,9 +453,10 @@ attempt_delivery(#delivery{txn = none, sender = ChPid, message = Message, msg_seq_no = MsgSeqNo}, - State = #q{backing_queue = BQ}) -> - IsPersistent = Message#basic_message.is_persistent, - case IsPersistent of + State = #q{backing_queue = BQ, q = Q}) -> + NeedsConfirming = Message#basic_message.is_persistent andalso + Q#amqqueue.durable, + case NeedsConfirming of false -> rabbit_channel:confirm(ChPid, MsgSeqNo); _ -> ok end, @@ -469,7 +470,7 @@ attempt_delivery(#delivery{txn = none, BQ:publish_delivered(AckRequired, Message, ?BASE_MESSAGE_PROPERTIES #message_properties { - needs_confirming = IsPersistent }, + needs_confirming = NeedsConfirming }, BQS), {{Message, false, AckTag}, true, State1#q{backing_queue_state = BQS1}} |