Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 1eb4d71

Browse files
committed
Rename nb_acceptors into num_{tcp,ssl}_acceptors
Also fix an undef call to cowboy:start_https/6 instead of ranch:start_listener/6.
1 parent 7c27e7a commit 1eb4d71

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/rabbit_web_mqtt_app.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ init([]) -> {ok, {{one_for_one, 1, 5}, []}}.
4040
%%----------------------------------------------------------------------------
4141

4242
mqtt_init() ->
43-
NbAcceptors = get_env(nb_acceptors, 1),
4443
CowboyOpts0 = get_env(cowboy_opts, []),
4544

4645
Routes = cowboy_router:compile([{'_', [
@@ -60,7 +59,7 @@ mqtt_init() ->
6059
end,
6160
TCPPort = proplists:get_value(port, TCPConf),
6261

63-
{ok, _} = ranch:start_listener(web_mqtt, NbAcceptors,
62+
{ok, _} = ranch:start_listener(web_mqtt, get_env(num_tcp_acceptors, 10),
6463
ranch_tcp, TCPConf,
6564
rabbit_web_mqtt_connection_sup, CowboyOpts),
6665

@@ -74,7 +73,7 @@ mqtt_init() ->
7473
rabbit_networking:ensure_ssl(),
7574
SSLPort = proplists:get_value(port, SSLConf),
7675

77-
{ok, _} = cowboy:start_https(web_mqtt_secure, NbAcceptors,
76+
{ok, _} = ranch:start_listener(web_mqtt_secure, get_env(num_ssl_acceptors, 1),
7877
ranch_ssl, SSLConf,
7978
rabbit_web_mqtt_connection_sup, CowboyOpts),
8079
rabbit_log:info("rabbit_web_mqtt: listening for HTTPS connections on ~s:~w~n",

src/rabbitmq_web_mqtt.app.src

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
{registered, []},
77
{mod, {rabbit_web_mqtt_app, []}},
88
{env, [{tcp_config, []},
9+
{num_tcp_acceptors, 10},
910
{ssl_config, []},
10-
{nb_acceptors, 1},
11+
{num_ssl_acceptors, 1},
1112
{cowboy_opts, []}]},
1213
{applications, [kernel, stdlib, rabbit, rabbitmq_mqtt, cowboy]}
1314
]}.

0 commit comments

Comments
 (0)