Merge pull request #9644 from id/fix-kafka-bridge-connectivity-detection
fix(kafka): detect connectivity in on_get_status
This commit is contained in:
commit
231d6da4dc
|
@ -81,7 +81,7 @@ t_create_success(_Config) ->
|
||||||
receive
|
receive
|
||||||
{Ref, token_created} ->
|
{Ref, token_created} ->
|
||||||
ok
|
ok
|
||||||
after 1_000 ->
|
after 5_000 ->
|
||||||
ct:fail(
|
ct:fail(
|
||||||
"should have confirmed token creation; msgs: ~0p",
|
"should have confirmed token creation; msgs: ~0p",
|
||||||
[process_info(self(), messages)]
|
[process_info(self(), messages)]
|
||||||
|
|
|
@ -173,8 +173,11 @@ on_kafka_ack(_Partition, _Offset, _Extra) ->
|
||||||
%% Maybe need to bump some counters?
|
%% Maybe need to bump some counters?
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
on_get_status(_InstId, _State) ->
|
on_get_status(_InstId, #{client_id := ClientID}) ->
|
||||||
connected.
|
case wolff:check_connectivity(ClientID) of
|
||||||
|
ok -> connected;
|
||||||
|
_ -> disconnected
|
||||||
|
end.
|
||||||
|
|
||||||
%% Parse comma separated host:port list into a [{Host,Port}] list
|
%% Parse comma separated host:port list into a [{Host,Port}] list
|
||||||
hosts(Hosts) ->
|
hosts(Hosts) ->
|
||||||
|
|
Loading…
Reference in New Issue