summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-03-25 13:16:08 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-03-25 13:16:08 +0000
commit076f5ad37213a503f4a7fa82d8e1d4a675062f84 (patch)
treea99c3388dd38eacc60c05857dee5471e7f562aa5
parent7dc15081000f8fe30167e3082001542b3e010015 (diff)
downloadrabbitmq-server-076f5ad37213a503f4a7fa82d8e1d4a675062f84.tar.gz
Our other consumer arg has an x- on it. Also, let's validate.
-rw-r--r--src/rabbit_amqqueue.erl6
-rw-r--r--src/rabbit_channel.erl2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl
index 85d1f283..f3a22fc2 100644
--- a/src/rabbit_amqqueue.erl
+++ b/src/rabbit_amqqueue.erl
@@ -436,7 +436,8 @@ declare_args() ->
{<<"x-dead-letter-routing-key">>, fun check_dlxrk_arg/2},
{<<"x-max-length">>, fun check_non_neg_int_arg/2}].
-consume_args() -> [{<<"x-priority">>, fun check_int_arg/2}].
+consume_args() -> [{<<"x-priority">>, fun check_int_arg/2},
+ {<<"x-cancel-on-ha-failover">>, fun check_bool_arg/2}].
check_int_arg({Type, _}, _) ->
case lists:member(Type, ?INTEGER_ARG_TYPES) of
@@ -444,6 +445,9 @@ check_int_arg({Type, _}, _) ->
false -> {error, {unacceptable_type, Type}}
end.
+check_bool_arg({bool, _}, _) -> ok;
+check_bool_arg({_, _}, _) -> {error, {unacceptable_type, Type}}.
+
check_non_neg_int_arg({Type, Val}, Args) ->
case check_int_arg({Type, Val}, Args) of
ok when Val >= 0 -> ok;
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index e59eca32..cafc507f 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -1283,7 +1283,7 @@ cancel_consumer(CTag, QName, State = #ch{consumer_mapping = CMap}) ->
queue_down_consumer_action(CTag, CMap) ->
{_, {_, _, _, Args} = ConsumeSpec} = dict:fetch(CTag, CMap),
- case rabbit_misc:table_lookup(Args, <<"cancel-on-ha-failover">>) of
+ case rabbit_misc:table_lookup(Args, <<"x-cancel-on-ha-failover">>) of
{bool, true} -> remove;
_ -> {recover, ConsumeSpec}
end.