summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-11-01 14:11:41 +0000
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-11-01 14:11:41 +0000
commit1a8ff3cd239fe4698cd9b65a9b6f34931857092f (patch)
tree115372a3cd98397692826ea38137602a29d53c72
parent16ff1b064f81859283fd7b4293a6d4fb4ee4f6d6 (diff)
downloadrabbitmq-server-1a8ff3cd239fe4698cd9b65a9b6f34931857092f.tar.gz
only wait for disk syncs for persistent messages on durable queues
-rw-r--r--src/rabbit_amqqueue_process.erl9
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}}