Skip to content

Commit

Permalink
Refresh OAuth token in the background
Browse files Browse the repository at this point in the history
So that OAUTHBEARER authentication works even when poll isn't being
called regularly (e.g., in a client just used for fetching metadata).
  • Loading branch information
benesch committed Aug 4, 2024
1 parent 1e27332 commit 80fffc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ impl<C: ClientContext + 'static> Client<C> {

unsafe { rdsys::rd_kafka_set_log_level(client_ptr, config.log_level as i32) };

if C::ENABLE_REFRESH_OAUTH_TOKEN {
unsafe { rdsys::rd_kafka_sasl_background_callbacks_enable(client_ptr) };
}

Ok(Client {
native: unsafe { NativeClient::from_ptr(client_ptr) },
context,
Expand Down

0 comments on commit 80fffc0

Please sign in to comment.