Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Spring Boot + Apache Kafka Real-World Wikimedia Project

Pragya Keshap answered on February 10, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Work with Apache Kafka in Spring Boot Application
  • kafka and spring boot configuration
  • Mention some real-world use cases of Apache Kafka

  • Spring Boot + Apache Kafka Real-World Wikimedia Project

    0

    KafkaAdmin - see Configuring Topics

    ProducerFactory - see Sending Messages

    ConsumerFactory - see Receiving Messages

    Starting with version 2.5, each of these extends KafkaResourceFactory. This allows changing the bootstrap servers at runtime by adding a Supplier to their configuration: setBootstrapServersSupplier(() → …​). This will be called for all new connections to get the list of servers. Consumers and Producers are generally long-lived. To close existing Producers, call reset() on the DefaultKafkaProducerFactory. To close existing Consumers, call stop() (and then start()) on the KafkaListenerEndpointRegistry and/or stop() and start() on any other listener container beans.

    For convenience, the framework also provides an ABSwitchCluster which supports two sets of bootstrap servers; one of which is active at any time. Configure the ABSwitchCluster and add it to the producer and consumer factories, and the KafkaAdmin, by calling setBootstrapServersSupplier(). When you want to switch, call primary() or secondary() and call reset() on the producer factory to establish new connection(s); for consumers, stop() and start() all listener containers. When using @KafkaListener s, stop() and start() the KafkaListenerEndpointRegistry bean.

    https://www.javaguides.net/2022/12/spring-boot-apache-kafka-tutorial-16.html

    Popularity 1/10 Helpfulness 1/10 Language java
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 10 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.