Add internal-purpose so we declare what these are for.

This commit is contained in:
Simon MacMullen 2013-09-05 15:26:16 +01:00
parent 3ff1fe7f6d
commit 7a9f8567f5
2 changed files with 12 additions and 6 deletions

View File

@ -410,9 +410,11 @@ consume_from_upstream_queue(
#upstream_params{x_or_q = X, #upstream_params{x_or_q = X,
params = Params} = UParams, params = Params} = UParams,
Q = upstream_queue_name(name(X), vhost(Params), DownXName), Q = upstream_queue_name(name(X), vhost(Params), DownXName),
Args = [Arg || {_K, _T, V} = Arg <- [{<<"x-expires">>, long, Expiry}, Args = [A || {_K, _T, V} = A
{<<"x-message-ttl">>, long, TTL}, <- [{<<"x-expires">>, long, Expiry},
{<<"x-ha-policy">>, longstr, HA}], {<<"x-message-ttl">>, long, TTL},
{<<"x-ha-policy">>, longstr, HA},
{<<"x-internal-purpose">>, longstr, <<"federation">>}],
V =/= none], V =/= none],
amqp_channel:call(Ch, #'queue.declare'{queue = Q, amqp_channel:call(Ch, #'queue.declare'{queue = Q,
durable = true, durable = true,
@ -483,9 +485,12 @@ ensure_internal_exchange(IntXNameBin,
durable = true, durable = true,
internal = true, internal = true,
auto_delete = true}, auto_delete = true},
Purpose = [{<<"x-internal-purpose">>, longstr, <<"federation">>}],
XFU = Base#'exchange.declare'{type = <<"x-federation-upstream">>, XFU = Base#'exchange.declare'{type = <<"x-federation-upstream">>,
arguments = [{?MAX_HOPS_ARG, long, MaxHops}]}, arguments = [{?MAX_HOPS_ARG, long, MaxHops} |
Fan = Base#'exchange.declare'{type = <<"fanout">>}, Purpose]},
Fan = Base#'exchange.declare'{type = <<"fanout">>,
arguments = Purpose},
rabbit_federation_link_util:disposable_connection_call( rabbit_federation_link_util:disposable_connection_call(
Params, XFU, fun(?COMMAND_INVALID, _Text) -> Params, XFU, fun(?COMMAND_INVALID, _Text) ->
amqp_channel:call(Ch, Fan) amqp_channel:call(Ch, Fan)

View File

@ -36,7 +36,8 @@
%%---------------------------------------------------------------------------- %%----------------------------------------------------------------------------
description() -> description() ->
[{description, <<"Federation upstream helper exchange">>}]. [{description, <<"Federation upstream helper exchange">>},
{internal_purpose, federation}].
serialise_events() -> false. serialise_events() -> false.