diff options
author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-18 15:56:31 +0100 |
---|---|---|
committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-04-18 15:56:31 +0100 |
commit | e133222d58265c805f701661259bf7310aeb32b1 (patch) | |
tree | ab10637daa468374cf9f763bde81179bf31204af | |
parent | 44dfd96de05e3e1df655093502e0fe6f8e38dbfd (diff) | |
download | rabbitmq-server-e133222d58265c805f701661259bf7310aeb32b1.tar.gz |
Re-creating bug24863 branching of default
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 3caf728b..2764c027 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -717,6 +717,14 @@ ensure_ttl_timer(State = #q{backing_queue = BQ, ensure_ttl_timer(State) -> State. +ack_nacked_messages(AckTags, State = #q{dlx = undefined, + backing_queue = BQ, + backing_queue_state = BQS }) -> + {_Guids, BQS1} = BQ:ack(AckTags, BQS), + State#q{backing_queue_state = BQS1}; +ack_nacked_messages(_AckTags, State) -> + State. + dead_letter_fun(_Reason, #q{dlx = undefined}) -> undefined; dead_letter_fun(Reason, _State) -> @@ -1226,13 +1234,16 @@ handle_cast({reject, AckTags, Requeue, ChPid}, State) -> noreply(subtract_acks( ChPid, AckTags, State, case Requeue of - true -> fun (State1) -> requeue_and_run(AckTags, State1) end; - false -> Fun = dead_letter_fun(rejected, State), - fun (State1 = #q{backing_queue = BQ, - backing_queue_state = BQS}) -> - BQS1 = BQ:fold(Fun, BQS, AckTags), - State1#q{backing_queue_state = BQS1} - end + true -> + fun (State1) -> requeue_and_run(AckTags, State1) end; + false -> + Fun = dead_letter_fun(rejected, State), + fun (State1 = #q{backing_queue = BQ, + backing_queue_state = BQS}) -> + BQS1 = BQ:fold(Fun, BQS, AckTags), + ack_nacked_messages( + AckTags, State1#q{backing_queue_state = BQS1}) + end end)); handle_cast(delete_immediately, State) -> |