fix(kafka): detect connectivity in on_get_status

This commit is contained in:
Ivan Dyachkov 2022-12-30 10:18:52 +01:00
parent f92b1fb8f4
commit 75770f2842
1 changed files with 5 additions and 2 deletions

View File

@ -173,8 +173,11 @@ on_kafka_ack(_Partition, _Offset, _Extra) ->
%% Maybe need to bump some counters?
ok.
on_get_status(_InstId, _State) ->
connected.
on_get_status(_InstId, #{client_id := ClientID}) ->
case wolff:check_connectivity(ClientID) of
ok -> connected;
_ -> disconnected
end.
%% Parse comma separated host:port list into a [{Host,Port}] list
hosts(Hosts) when is_binary(Hosts) ->