Skip to content

Commit e6eef88

Browse files
committed
Use 1.0 instead of 0.9.1 client for 1.0 tests
1 parent e21007f commit e6eef88

File tree

4 files changed

+134
-178
lines changed

4 files changed

+134
-178
lines changed

deps/rabbit/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ rabbitmq_integration_suite(
12521252
],
12531253
shard_count = 3,
12541254
runtime_deps = [
1255-
"//deps/amqp10_client:erlang_app",
1255+
"//deps/rabbitmq_amqp_client:erlang_app",
12561256
],
12571257
)
12581258

deps/rabbit/src/rabbit_amqp_management.erl

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ handle_http_req(<<"DELETE">>,
209209
fun (Q) ->
210210
case rabbit_queue_type:purge(Q) of
211211
{ok, NumMsgs} ->
212-
RespPayload = {map, [{{utf8, <<"message_count">>}, {ulong, NumMsgs}}]},
212+
RespPayload = {map, [{{utf8, <<"message_count">>},
213+
{ulong, NumMsgs}}]},
213214
{<<"200">>, RespPayload};
214215
{error, not_supported} ->
215216
throw(<<"400">>,
@@ -234,7 +235,8 @@ handle_http_req(<<"DELETE">>,
234235
ok = check_resource_access(QName, configure, User),
235236
try rabbit_amqqueue:delete_with(QName, ConnPid, false, false, Username, true) of
236237
{ok, NumMsgs} ->
237-
RespPayload = {map, [{{utf8, <<"message_count">>}, {ulong, NumMsgs}}]},
238+
RespPayload = {map, [{{utf8, <<"message_count">>},
239+
{ulong, NumMsgs}}]},
238240
{<<"200">>, RespPayload}
239241
catch exit:#amqp_error{explanation = Explanation} ->
240242
throw(<<"400">>, Explanation, [])
@@ -343,15 +345,8 @@ decode_queue({map, KVList}) ->
343345
({{utf8, <<"auto_delete">>}, V}, Acc)
344346
when is_boolean(V) ->
345347
Acc#{auto_delete => V};
346-
({{utf8, <<"arguments">>}, {map, List}}, Acc) ->
347-
Args = lists:map(fun({{utf8, Key = <<"x-", _/binary>>}, {utf8, Val}}) ->
348-
{Key, longstr, Val};
349-
(Arg) ->
350-
throw(<<"400">>,
351-
"unsupported queue argument ~tp",
352-
[Arg])
353-
end, List),
354-
Acc#{arguments => Args};
348+
({{utf8, <<"arguments">>}, Args}, Acc) ->
349+
Acc#{arguments => args_amqp_to_amqpl(Args)};
355350
(Prop, _Acc) ->
356351
throw(<<"400">>, "bad queue property ~tp", [Prop])
357352
end, #{}, KVList),
@@ -442,15 +437,8 @@ decode_exchange({map, KVList}) ->
442437
({{utf8, <<"internal">>}, V}, Acc)
443438
when is_boolean(V) ->
444439
Acc#{internal => V};
445-
({{utf8, <<"arguments">>}, {map, List}}, Acc) ->
446-
Args = lists:map(fun({{utf8, Key = <<"x-", _/binary>>}, {utf8, Val}}) ->
447-
{Key, longstr, Val};
448-
(Arg) ->
449-
throw(<<"400">>,
450-
"unsupported exchange argument ~tp",
451-
[Arg])
452-
end, List),
453-
Acc#{arguments => Args};
440+
({{utf8, <<"arguments">>}, Args}, Acc) ->
441+
Acc#{arguments => args_amqp_to_amqpl(Args)};
454442
(Prop, _Acc) ->
455443
throw(<<"400">>, "bad exchange property ~tp", [Prop])
456444
end, #{}, KVList),
@@ -471,17 +459,8 @@ decode_binding({map, KVList}) ->
471459
Acc#{destination_exchange => V};
472460
({{utf8, <<"binding_key">>}, {utf8, V}}, Acc) ->
473461
Acc#{binding_key => V};
474-
({{utf8, <<"arguments">>}, {map, List}}, Acc) ->
475-
Args = lists:map(fun({{T, Key}, TypeVal})
476-
when T =:= utf8 orelse
477-
T =:= symbol ->
478-
mc_amqpl:to_091(Key, TypeVal);
479-
(Arg) ->
480-
throw(<<"400">>,
481-
"unsupported binding argument ~tp",
482-
[Arg])
483-
end, List),
484-
Acc#{arguments => Args};
462+
({{utf8, <<"arguments">>}, Args}, Acc) ->
463+
Acc#{arguments => args_amqp_to_amqpl(Args)};
485464
(Field, _Acc) ->
486465
throw(<<"400">>, "bad binding field ~tp", [Field])
487466
end, #{}, KVList).
@@ -511,6 +490,17 @@ encode_bindings(Bindings) ->
511490
end, Bindings),
512491
{list, Bs}.
513492

493+
args_amqp_to_amqpl({map, KVList}) ->
494+
lists:map(fun({{T, Key}, TypeVal})
495+
when T =:= utf8 orelse
496+
T =:= symbol ->
497+
mc_amqpl:to_091(Key, TypeVal);
498+
(Arg) ->
499+
throw(<<"400">>,
500+
"unsupported argument ~tp",
501+
[Arg])
502+
end, KVList).
503+
514504
args_amqpl_to_amqp(Args) ->
515505
{map, [{{utf8, K}, mc_amqpl:from_091(T, V)} || {K, T, V} <- Args]}.
516506

0 commit comments

Comments
 (0)