librdkafka
The Apache Kafka C/C++ client library
RdKafka::OAuthBearerTokenRefreshCb Class Referenceabstract

SASL/OAUTHBEARER token refresh callback class. More...

#include <rdkafkacpp.h>

Public Member Functions

virtual void oauthbearer_token_refresh_cb (RdKafka::Handle *handle, const std::string &oauthbearer_config)=0
 SASL/OAUTHBEARER token refresh callback class. More...
 

Detailed Description

SASL/OAUTHBEARER token refresh callback class.

The SASL/OAUTHBEARER token refresh callback is triggered via RdKafka::poll() whenever OAUTHBEARER is the SASL mechanism and a token needs to be retrieved, typically based on the configuration defined in sasl.oauthbearer.config.

The oauthbearer_config argument is the value of the sasl.oauthbearer.config configuration property.

The callback should invoke RdKafka::Handle::oauthbearer_set_token() or RdKafka::Handle::oauthbearer_set_token_failure() to indicate success or failure, respectively.

The refresh operation is eventable and may be received when an event callback handler is set with an event type of RdKafka::Event::EVENT_OAUTHBEARER_TOKEN_REFRESH.

Note that before any SASL/OAUTHBEARER broker connection can succeed the application must call RdKafka::Handle::oauthbearer_set_token() once – either directly or, more typically, by invoking RdKafka::poll() – in order to cause retrieval of an initial token to occur.

An application must call RdKafka::poll() at regular intervals to serve queued SASL/OAUTHBEARER token refresh callbacks (when OAUTHBEARER is the SASL mechanism).

Member Function Documentation

◆ oauthbearer_token_refresh_cb()

virtual void RdKafka::OAuthBearerTokenRefreshCb::oauthbearer_token_refresh_cb ( RdKafka::Handle handle,
const std::string &  oauthbearer_config 
)
pure virtual

SASL/OAUTHBEARER token refresh callback class.

Parameters
handleThe RdKafka::Handle which requires a refreshed token.
oauthbearer_configThe value of the sasl.oauthbearer.config configuration property for handle.

The documentation for this class was generated from the following file: