test(pulsar): fix pulsar consumer ssl opts
This commit is contained in:
parent
89a61bc3bc
commit
bfc02d1ccf
|
@ -385,7 +385,6 @@ start_consumer(TestCase, Config) ->
|
||||||
<<Scheme/binary, (list_to_binary(PulsarHost))/binary, ":",
|
<<Scheme/binary, (list_to_binary(PulsarHost))/binary, ":",
|
||||||
(integer_to_binary(PulsarPort))/binary>>
|
(integer_to_binary(PulsarPort))/binary>>
|
||||||
),
|
),
|
||||||
ConnOpts = #{},
|
|
||||||
ConsumerClientId = list_to_atom(
|
ConsumerClientId = list_to_atom(
|
||||||
atom_to_list(TestCase) ++ integer_to_list(erlang:unique_integer())
|
atom_to_list(TestCase) ++ integer_to_list(erlang:unique_integer())
|
||||||
),
|
),
|
||||||
|
@ -396,15 +395,9 @@ start_consumer(TestCase, Config) ->
|
||||||
certfile => filename:join([CertsPath, "cert.pem"]),
|
certfile => filename:join([CertsPath, "cert.pem"]),
|
||||||
cacertfile => filename:join([CertsPath, "cacert.pem"])
|
cacertfile => filename:join([CertsPath, "cacert.pem"])
|
||||||
},
|
},
|
||||||
{ok, _ClientPid} = pulsar:ensure_supervised_client(
|
Opts = #{enable_ssl => UseTLS, ssl_opts => emqx_tls_lib:to_client_opts(SSLOpts)},
|
||||||
ConsumerClientId,
|
{ok, _ClientPid} = pulsar:ensure_supervised_client(ConsumerClientId, [URL], Opts),
|
||||||
[URL],
|
ConsumerOpts = Opts#{
|
||||||
#{
|
|
||||||
conn_opts => ConnOpts,
|
|
||||||
ssl_opts => emqx_tls_lib:to_client_opts(SSLOpts)
|
|
||||||
}
|
|
||||||
),
|
|
||||||
ConsumerOpts = #{
|
|
||||||
cb_init_args => #{send_to => self()},
|
cb_init_args => #{send_to => self()},
|
||||||
cb_module => pulsar_echo_consumer,
|
cb_module => pulsar_echo_consumer,
|
||||||
sub_type => 'Shared',
|
sub_type => 'Shared',
|
||||||
|
@ -414,8 +407,7 @@ start_consumer(TestCase, Config) ->
|
||||||
%% id, or else weird bugs will happen, like the
|
%% id, or else weird bugs will happen, like the
|
||||||
%% consumer never starts...
|
%% consumer never starts...
|
||||||
name => list_to_atom("test_consumer" ++ integer_to_list(erlang:unique_integer())),
|
name => list_to_atom("test_consumer" ++ integer_to_list(erlang:unique_integer())),
|
||||||
consumer_id => 1,
|
consumer_id => 1
|
||||||
conn_opts => ConnOpts
|
|
||||||
},
|
},
|
||||||
{ok, Consumer} = pulsar:ensure_supervised_consumers(
|
{ok, Consumer} = pulsar:ensure_supervised_consumers(
|
||||||
ConsumerClientId,
|
ConsumerClientId,
|
||||||
|
|
Loading…
Reference in New Issue