Kafka Client Application
Last updated
Last updated
This section provides sample code snippets to configure Service Registry Kafka serializer/deserializer (SerDes) configuration properties to access the secure Service Registry server.
Apicurio Registry supports both OAuth and BASIC auth at the same time. a custom authentication handler has been implemented to use OAuth Client Credentials flow to support BASIC auth. In other words, the client can provide BASIC auth credentials, and the server-side custom handler will extract the username/password and then use OAuth Client Credentials flow against the Keycloak server to obtain an access token. Once that is done, everything else works the same as if the client had provided an OAuth bearer token to begin with.
Visit for detailed information on how to configure Kafka SerDes in your producer and consumer Java client applications.
We're going to use for demostration. Visit for more Java example applications.
Based on the authentication mechanism you're using for Service Registry, you need to update the when creating Kaka and object as the snippets below.
Basic Authentication configuration
OAuth configuration
If the Kafka serializer/deserializer (SerDes) configuration properties are correct, you should be able to see application output similar to this when you run the application. This means the client application can connect and authenticate to Service Registry successfully.