Merge pull request #9644 from id/fix-kafka-bridge-connectivity-detection

fix(kafka): detect connectivity in on_get_status
This commit is contained in:
Zaiming (Stone) Shi 2022-12-30 21:54:56 +01:00 committed by GitHub
commit 231d6da4dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -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)]

View File

@ -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) ->