librdkafka
The Apache Kafka C/C++ client library
|
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... | |
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).
|
pure virtual |
SASL/OAUTHBEARER token refresh callback class.
handle | The RdKafka::Handle which requires a refreshed token. |
oauthbearer_config | The value of the sasl.oauthbearer.config configuration property for handle . |