Skip to content

Commit 2249282

Browse files
committed
rabbit_channel: Restore start_link/11 for backward compatibility
start_link/11 calls start_link/12 with AmqpParams set to `undefined`. This is what rabbit_channel_sup was doing as well as rabbit_ct_broker_helpers in rabbitmq-ct-helpers. Those modules use the restored start_link/11 again so the default value of AmqpParams is stored in one place only. (cherry picked from commit ce44331)
1 parent 60f6237 commit 2249282

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/rabbit_channel.erl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
-behaviour(gen_server2).
5757

58-
-export([start_link/12, do/2, do/3, do_flow/3, flush/1, shutdown/1]).
58+
-export([start_link/11, start_link/12, do/2, do/3, do_flow/3, flush/1, shutdown/1]).
5959
-export([send_command/2, deliver/4, deliver_reply/2,
6060
send_credit_reply/2, send_drained/2]).
6161
-export([list/0, info_keys/0, info/1, info/2, info_all/0, info_all/1,
@@ -237,6 +237,17 @@
237237

238238
%%----------------------------------------------------------------------------
239239

240+
-spec start_link
241+
(channel_number(), pid(), pid(), pid(), string(), rabbit_types:protocol(),
242+
rabbit_types:user(), rabbit_types:vhost(), rabbit_framing:amqp_table(),
243+
pid(), pid()) ->
244+
rabbit_types:ok_pid_or_error().
245+
246+
start_link(Channel, ReaderPid, WriterPid, ConnPid, ConnName, Protocol, User,
247+
VHost, Capabilities, CollectorPid, Limiter) ->
248+
start_link(Channel, ReaderPid, WriterPid, ConnPid, ConnName, Protocol, User,
249+
VHost, Capabilities, CollectorPid, Limiter, undefined).
250+
240251
-spec start_link
241252
(channel_number(), pid(), pid(), pid(), string(), rabbit_types:protocol(),
242253
rabbit_types:user(), rabbit_types:vhost(), rabbit_framing:amqp_table(),

src/rabbit_channel_sup.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ start_link({tcp, Sock, Channel, FrameMax, ReaderPid, ConnName, Protocol, User,
6666
{channel, {rabbit_channel, start_link,
6767
[Channel, ReaderPid, WriterPid, ReaderPid, ConnName,
6868
Protocol, User, VHost, Capabilities, Collector,
69-
LimiterPid, undefined]},
69+
LimiterPid]},
7070
intrinsic, ?FAIR_WAIT, worker, [rabbit_channel]}),
7171
{ok, AState} = rabbit_command_assembler:init(Protocol),
7272
{ok, SupPid, {ChannelPid, AState}};

0 commit comments

Comments
 (0)