summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2010-08-13 16:36:37 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2010-08-13 16:36:37 +0100
commitc6cece479f62dbefd64976c0b86babb3d5c996d7 (patch)
tree147c1ce1436bc577cc479ff87db366cb1a0e7e7e
parentb4e72e423bb26ad9b139b6fe86571ae150a0b72c (diff)
downloadrabbitmq-server-git-c6cece479f62dbefd64976c0b86babb3d5c996d7.tar.gz
pubacks are sent right after basic.returns
-rw-r--r--src/rabbit_channel.erl20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index fe30326133..85bae8e45b 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -497,17 +497,21 @@ handle_method(#'basic.publish'{exchange = ExchangeNameBin,
rabbit_exchange:publish(
Exchange,
rabbit_basic:delivery(Mandatory, Immediate, TxnKey, Message)),
- case RoutingRes of
- routed -> ok;
- unroutable -> ok = basic_return(Message, WriterPid, no_route);
- not_delivered -> ok = basic_return(Message, WriterPid, no_consumers)
- end,
+ State2 = case RoutingRes of
+ routed -> State1;
+ unroutable ->
+ ok = basic_return(Message, WriterPid, no_route),
+ send_or_enqueue_ack(MsgSeqNo, State1);
+ not_delivered ->
+ ok = basic_return(Message, WriterPid, no_consumers),
+ send_or_enqueue_ack(MsgSeqNo, State1)
+ end,
maybe_incr_stats([{ExchangeName, 1} |
[{{QPid, ExchangeName}, 1} ||
- QPid <- DeliveredQPids]], publish, State1),
+ QPid <- DeliveredQPids]], publish, State2),
{noreply, case TxnKey of
- none -> State1;
- _ -> add_tx_participants(DeliveredQPids, State1)
+ none -> State2;
+ _ -> add_tx_participants(DeliveredQPids, State2)
end};
handle_method(#'basic.ack'{delivery_tag = DeliveryTag,