diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-13 17:16:16 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2010-08-13 17:16:16 +0100 |
commit | 02eac84cd7d15916f5bc9e23ee39845625cf9db8 (patch) | |
tree | 4f81a64b6551aaedd78a00944d87c2fa04605fa9 /src/rabbit_router.erl | |
parent | ca082c57372da1fc05977df657b1956f01f479db (diff) | |
download | rabbitmq-server-02eac84cd7d15916f5bc9e23ee39845625cf9db8.tar.gz |
puback for persistent non-mandatory, non-immediate, unrouted messages
Diffstat (limited to 'src/rabbit_router.erl')
-rw-r--r-- | src/rabbit_router.erl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl index ec049a1a..14d93497 100644 --- a/src/rabbit_router.erl +++ b/src/rabbit_router.erl @@ -54,7 +54,8 @@ %%---------------------------------------------------------------------------- deliver(QPids, Delivery = #delivery{mandatory = false, - immediate = false}) -> + immediate = false, + message = Msg}) -> %% optimisation: when Mandatory = false and Immediate = false, %% rabbit_amqqueue:deliver will deliver the message to the queue %% process asynchronously, and return true, which means all the @@ -64,6 +65,11 @@ deliver(QPids, Delivery = #delivery{mandatory = false, %% case below. delegate:invoke_no_result( QPids, fun (Pid) -> rabbit_amqqueue:deliver(Pid, Delivery) end), + case {QPids, Msg#basic_message.msg_seq_no} of + {[], undefined} -> ok; + {[], MsgSeqNo} -> rabbit_channel:confirm(Msg#basic_message.origin, MsgSeqNo); + _ -> ok + end, {routed, QPids}; deliver(QPids, Delivery) -> |