Este conteúdo não está disponível no idioma selecionado.

Chapter 3. Adding client dependencies to your Maven project


If you are developing Java-based Kafka clients, you can add the Red Hat dependencies for Kafka clients, including Kafka Streams, to the pom.xml file of your Maven project. Only client libraries built by Red Hat are supported for AMQ Streams.

You can add the following artifacts as dependencies:

kafka-clients

Contains the Kafka Producer, Consumer, and AdminClient APIs.

  • The Producer API enables applications to send data to a Kafka broker.
  • The Consumer API enables applications to consume data from a Kafka broker.
  • The AdminClient API provides functionality for managing Kafka clusters, including topics, brokers, and other components.
kafka-streams

Contains the KafkaStreams API.

Kafka Streams enables applications to receive data from one or more input streams. You can use this API to run a sequence of real-time operations on streams of data, like mapping, filtering, and joining. You can use Kafka Streams to write results into one or more output streams. It is part of the kafka-streams JAR package that is available in the Red Hat Maven repository.

3.1. Adding a Kafka clients dependency to your Maven project

Add a Red Hat dependency for Kafka clients to your Maven project.

Prerequisites

  • A Maven project with an existing pom.xml.

Procedure

  1. Add the Red Hat Maven repository to the <repositories> section of the pom.xml file of your Maven project.

    <repositories>
        <repository>
            <id>redhat-maven</id>
            <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
    </repositories>
    Copy to Clipboard Toggle word wrap
  2. Add kafka-clients as a <dependency> to the pom.xml file of your Maven project.

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>3.6.0.redhat-00005</version>
        </dependency>
    </dependencies>
    Copy to Clipboard Toggle word wrap
  3. Build the Maven project to add the Kafka client dependency to the project.

3.2. Adding a Kafka Streams dependency to your Maven project

Add a Red Hat dependency for Kafka Streams to your Maven project.

Prerequisites

  • A Maven project with an existing pom.xml.

Procedure

  1. Add the Red Hat Maven repository to the <repositories> section of the pom.xml file of your Maven project.

    <repositories>
        <repository>
            <id>redhat-maven</id>
            <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
    </repositories>
    Copy to Clipboard Toggle word wrap
  2. Add kafka-streams as a <dependency> to the pom.xml file of your Maven project.

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-streams</artifactId>
            <version>3.6.0.redhat-00005</version>
        </dependency>
    </dependencies>
    Copy to Clipboard Toggle word wrap
  3. Build the Maven project to add the Kafka Streams dependency to the project.

3.3. Adding an OAuth 2.0 dependency to your Maven project

Add a Red Hat dependency for OAuth 2.0 to your Maven project.

Prerequisites

  • A Maven project with an existing pom.xml.

Procedure

  1. Add the Red Hat Maven repository to the <repositories> section of the pom.xml file of your Maven project.

    <repositories>
        <repository>
            <id>redhat-maven</id>
            <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
    </repositories>
    Copy to Clipboard Toggle word wrap
  2. Add kafka-oauth-client as a <dependency> to the pom.xml file of your Maven project.

    <dependency>
     <groupId>io.strimzi</groupId>
     <artifactId>kafka-oauth-client</artifactId>
     <version>0.14.0.redhat-00006</version>
    </dependency>
    Copy to Clipboard Toggle word wrap
  3. Build the Maven project to add the OAuth 2.0 dependency to the project.
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat