Apache Kafka® Consumer Example using SpringBoot 3 | Consumer Groups | Java Techie

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 100

  • @satyabatigoswami1735
    @satyabatigoswami1735 10 месяцев назад +5

    Got to understand kafka by following your tutorials. So clear explanation!! You are great😇

  • @amankumar-f4n5r
    @amankumar-f4n5r Год назад +6

    just started watching your video of kafka today at 10 am morning. I couldn't stop myself and its 2 am next day just completed your all videos of kafka with hands on. Just one suggestions keep your kafka consumer topic in kafka playlist otherwise many can miss tracking this .Also i'm waiting for other kafka topics like kafka connect with database where messages are being received from different source system which kafka server listen and stores those in our database and vice versa

    • @Javatechie
      @Javatechie  Год назад +4

      Waoo super excitement.thanks buddy i will definitely cover all concepts of Kafka

    • @phanividiyala1250
      @phanividiyala1250 Месяц назад

      I like your videos

  • @SivaChaitanyaReddySanivarapu
    @SivaChaitanyaReddySanivarapu Год назад +3

    Great topic, we are using this in my billing project

  • @SystemDesign-fn9zu
    @SystemDesign-fn9zu 9 месяцев назад +1

    Thanks

    • @Javatechie
      @Javatechie  9 месяцев назад

      Thank you buddy 😊

  • @Ujwal-k8k
    @Ujwal-k8k 2 месяца назад +1

    No words. Awesome lecture !!!...

  • @dileepkumarsattaru1909
    @dileepkumarsattaru1909 Год назад +3

    Nice Basant, Keep going with this series...

  • @GunelMammadova93
    @GunelMammadova93 10 месяцев назад +1

    Thanks for the amazing tutorial!

  • @AleksandarT10
    @AleksandarT10 Год назад +2

    Great video!
    Explains how Kafka Consumers work pretty clearly. As an idea for the next video/s, you can go over more of the properties of Kafka for Producers/Consumers - and explain concepts like batching, the most common properties that can be configured (like manual acknowledgement or not) etc

    • @Javatechie
      @Javatechie  Год назад +3

      Thanks for the tips! That's what's on my queue 🤪

  • @ankurverma4592
    @ankurverma4592 Год назад

    awesome explanation able to learn the whole very well. Thank you

  • @amankumar-f4n5r
    @amankumar-f4n5r Год назад +1

    you are awesome Basant

  • @maximilian_gl
    @maximilian_gl Год назад +1

    Very nice and helpful!

  • @sharmarahul17
    @sharmarahul17 Год назад

    Excellent video!

  • @Зебратв-п7э
    @Зебратв-п7э Год назад +3

    thank you for your tutuorial easy to understand
    but i have question is it possible to miss data in kafka between producer and consumer process
    if it likes that how can i avoid missing data

    • @Javatechie
      @Javatechie  Год назад +1

      We need to implement a retry i will cover that

  • @ravi.m4954
    @ravi.m4954 Год назад +2

    Nice explanation. Can you cover in upcoming videos like how can we replay or retry lagged messages and how to identify which messages lagged and how to replay those .

  • @phanividiyala1250
    @phanividiyala1250 Месяц назад

    Could you please explain with router component calling producer and consumer logic

  • @ramsharan4229
    @ramsharan4229 Год назад +1

    awesome

  • @vaishali5.r
    @vaishali5.r Год назад +1

    Hi Basant, thank you for an excellent informative video. What I do not understand about the lag is, if Kafka stores the messages for minimum one week, then why do we have to republish the messages which are in the lag. Why it will not automatically be reprocessed when the consumer is back up and running?

    • @Javatechie
      @Javatechie  Год назад

      It will automatically be consumed by the consumer once it goes back to online. But republish required when you want to resend a particular events

  • @SandeepPuvvada-u5p
    @SandeepPuvvada-u5p Год назад +1

    Good Explanation basant. Great work. I have one quick question you change the group id in the java class but not changed in yml still application works fine. Then what is the point of adding the group id in yml.

    • @Javatechie
      @Javatechie  Год назад

      Either or you can add buddy. I forgot to mention that in video

  • @shubhammotghare783
    @shubhammotghare783 5 месяцев назад

    Hey, 1st of all thank you for the great tutorial. I've one question. When you change the group-id in service class, is it not mandatory to change or add that new group-id in application.yml ?

  • @geekdeb5363
    @geekdeb5363 Год назад +1

    Great , If you can enlighten on the real time project prospective, it would be great

    • @Javatechie
      @Javatechie  Год назад +2

      I will do one e2e project using microservice that time will cover that scenario

    • @geekdeb5363
      @geekdeb5363 Год назад +1

      @@Javatechie Thank you 😊

  • @appstude6247
    @appstude6247 Год назад

    thank you for the video. can please tell me what's will happen if you start kafka-consumer-example project twice ? how many consumer will have ? 3 consumer in each instance ?

  • @VIKASSINGH-jf6jd
    @VIKASSINGH-jf6jd Год назад +1

    Basant. How do you create this beautiful presentation ? Which tool do you use or animation ?

    • @Javatechie
      @Javatechie  Год назад

      No animation buddy it's simple Microsoft power point

  • @RochaNahuel
    @RochaNahuel Год назад +1

    The example is clear and I like it , but these 3 consumers who are listening to the same topic and working together , could call the same method of the logica layer without problems ?

    • @Javatechie
      @Javatechie  Год назад

      Yes no problem at all because message will not be duplicate

  • @dhamodharankrishnamoorthi1921
    @dhamodharankrishnamoorthi1921 8 месяцев назад

    How i can create multiple consumer group, and consume message concurrent please explain

  • @santhu8525
    @santhu8525 3 месяца назад

    can we have multiple consumer groups with same groupid and reading same topic ? can anyone share answer and also i need all kafka realated questions .....Java Techie is very good and also i need one video for all kafka questions and answers experienced level

  • @gauravsrivastava3884
    @gauravsrivastava3884 Год назад +1

    Hi Basant !! Can you please all the necessary videos of this particular Kafka series to a RUclips Playlist. It will make it easy to access all relevant videos from one place. And as and when you create new videos, you can add them to the playlist. Thanks!

  • @raghugattu296
    @raghugattu296 Год назад +2

    Hi,
    Instead of creating new consumer groups, can we not increase threads count to 3 in one method using thread property?

    • @Javatechie
      @Javatechie  Год назад

      I will cover that content buddy

  • @LearncodewithMuneeb
    @LearncodewithMuneeb Год назад

    Thanks sir for making useful videos for us.
    But I request you very respectfully to work in a project in spring boot having at least 6 entities/tables using spring boot in the back end and React/Angular/Next in the front end

  • @p.kirankumar5328
    @p.kirankumar5328 Месяц назад

    If I restart the consumer, will it continue to read the lag messages?

  • @royjose.
    @royjose. 8 месяцев назад +1

    once the consumer is enabled again, will the lag values reach the consumer automatically?

    • @Javatechie
      @Javatechie  8 месяцев назад +2

      Yes it will process automatically once consumer back to online

  • @entertainer-xyz7562
    @entertainer-xyz7562 Год назад +1

    Hi Basant , I was going through this Kafka tutorial, I got a question on groupid that you have assigned to multiple consumers. My question is can we provide different groupid to different consumers?

    • @Javatechie
      @Javatechie  Год назад

      Yes we can I just defined it to same consumer to just demonstrate partition and consumer relationship

  • @RaviKumar-v9b6m
    @RaviKumar-v9b6m 9 месяцев назад

    Hi can you create videos on Kafka stream?

  • @mohammedsardar3779
    @mohammedsardar3779 Год назад +2

    Mesage consumption is decided by leader broker and not by the zookeeper. Zukeeper will be keeping the status of brokers and act as coordinator for all the brokers. Am I wrong Basant?

  • @Chinmay0692010
    @Chinmay0692010 Год назад +1

    If consumers get shut down while consuming, so if we start again the consumers , will it not take those messages which was not consumed….?

    • @Javatechie
      @Javatechie  Год назад

      Yes he will start picking based on what last offset he read before

  • @NareshSilpa-o1h
    @NareshSilpa-o1h Год назад +1

    Hi brother, Good Evening, i would like to join your - Spring boot & Micro service sessions. so Kindly guide me on that, How to register and talk to you. Thanks!

    • @Javatechie
      @Javatechie  Год назад

      Hello buddy please checkout any video description I have shared the course link and coupon code for course but still if you are getting confused then please refer to this video ruclips.net/video/84KZa4dFLTo/видео.html

  • @pavanreddy3162
    @pavanreddy3162 Год назад

    how long the messages are store in kafka?

  • @hanumanthram6754
    @hanumanthram6754 Год назад +1

    If the consumer is stopped then it should continue to consume the data based on the offset. is that correct understanding?

    • @Javatechie
      @Javatechie  Год назад

      No if the consumer is shut down then what to consume and who will consume buddy?

    • @hanumanthram6754
      @hanumanthram6754 Год назад

      @@Javatechie I mean if that consumer stopped nd again restarted that consumer will continue to consume the data based on offset. Is that not possible. Like in real-time producer produced data and stored in topic and consumer should consume data and put that in database if consumer server stopped in the middle and again again restarted can't that consumer group continue to consume the data based on offset? It is my question

    • @hanumanthram6754
      @hanumanthram6754 Год назад +1

      Offset Management:
      1. Kafka maintains the offset for each consumer group. When a consumer reads messages from a topic, it keeps track of the offset of the last message it has processed for each partition.
      The offset is stored in a Kafka topic called __consumer_offsets. Kafka brokers manage the offset commits and offsets are periodically committed by the consumer group coordinator.
      Consumer Restart Behavior:
      2. When a consumer is stopped or goes down, the next time it restarts, it will retrieve its last committed offset for each partition from the __consumer_offsets topic.
      Upon restarting, the consumer will begin to consume messages from the topics starting at the last committed offset for each partition.
      This ensures that the consumer continues from where it left off, processing messages that were not yet consumed before the shutdown

  • @PradeepKumar-sx6ms
    @PradeepKumar-sx6ms Год назад +1

    Are any videos on kafka coming?

    • @Javatechie
      @Javatechie  Год назад

      Yes error handling and retry

  • @rahulprakash5045
    @rahulprakash5045 9 месяцев назад +1

    is it required to add consumer group ?

    • @Javatechie
      @Javatechie  9 месяцев назад

      Yes it's mandatory steps to do

  • @saurabhmaurya6964
    @saurabhmaurya6964 Год назад +1

    how can we fetch all the messages from the particular topic after hitting end-point url ?..Help me with this..I tried To do with the help of KafkaConsumer consumer .. this has a method poll .. but after hitting end point i'm getting null in consumer..please help me with this ..

    • @Javatechie
      @Javatechie  Год назад

      What field you are getting null ?

    • @saurabhmaurya6964
      @saurabhmaurya6964 Год назад +1

      @@Javatechie in the consumer.poll section..can we connect seperately on meet so I can show you there?..

    • @Javatechie
      @Javatechie  Год назад

      @@saurabhmaurya6964 sure please drop me an email to javatechie4u@gmail.com

  • @kartikjain3064
    @kartikjain3064 Год назад +1

    Hi, so we no need of define ProducerFactory, ConsumerFactory in our code

    • @Javatechie
      @Javatechie  Год назад

      That will be my next video don't worry

  • @BhanuNandanaPavanKumarBavirise
    @BhanuNandanaPavanKumarBavirise 4 месяца назад

    How to write consumer instances dynamically in a single method...for every consumer instance you have created one method but only one method should multiple consumer instances naa?

  • @Gsuresh_3
    @Gsuresh_3 Год назад +1

    Hello, Recently I faced a question in interview, if I give a java project along with remote server without any IDE how you run that project. Can you make a video on it

    • @RamanujaSvl
      @RamanujaSvl 2 дня назад

      Depends, there's no single answer here, first of all how is this Java application packaged, jar, war or something else and then you have ensure that necessary dependencies are bundled and use appropriate command based on how the application is packaged and if it's not packaged you just run the main class 😅

  • @siddharthanepal1962
    @siddharthanepal1962 Год назад +1

    Hi can you make video for how kafka handle duplicates events or messages. What if producer send same events/message twice and how consumer will acknowledge the duplicates?

    • @Javatechie
      @Javatechie  Год назад

      Okay sure i will do that

    • @rakushhkar4225
      @rakushhkar4225 Год назад

      How does your Producer send messages in the Queue is most important. If you send messages in a sequential way using some ID like OrderId then the message content may be duplicated but atleast the order is not. Resending messages is required if original previous message were not processed properly. There is Transaction API that supports Once Processing. Alternative is to have a Dedupe check on Consumer. But why are you insisting on non to allow duplicate messages is to be answered by you.

    • @siddharthanepal1962
      @siddharthanepal1962 Год назад

      @rakushhkar4225 Recently, in an interview, I got this question. The interviewer asked me what happens when an exception occurs during message processing on the consumer side. How will the consumer process the failed messages? I am a beginner with kafka. If you have some videos tutorial or sameple codes, please suggest.

    • @rakushhkar4225
      @rakushhkar4225 Год назад +2

      @@siddharthanepal1962 Also better get RabbitMQ installed to see the console where all messages are processed and stored and the parameter D is very important. Work on Stream and Quorum messages in detail too along with Classic type

    • @mohammedsardar3779
      @mohammedsardar3779 Год назад +2

      There is an Idempotency property along with producer that helps here to avoid duplicates message process. Just shared a point of knowledge. If this is enabled broker will ignore the repetative message for uniqueness.

  • @saravanakumars52
    @saravanakumars52 Год назад +1

    What about @EnableKafka annotation??

  • @pnamm6501
    @pnamm6501 Год назад +1

    Great video. Can you cover avro schema and retry mechanism and also how handle any exception when processing message consumption?

    • @Javatechie
      @Javatechie  Год назад

      I will do that exception handling

  • @arunprabu6137
    @arunprabu6137 Год назад

    Bro how to connect offset kafka

  • @VivekSharma-gd3om
    @VivekSharma-gd3om 2 дня назад +1

    Sir audio is not available

    • @Javatechie
      @Javatechie  День назад

      It's available buddy please check your system configuration

  • @ReplayButton_7518
    @ReplayButton_7518 Год назад

    It is not working for me can , the message producer worked fine but I got nothing on message consumer

  • @rishiraj2548
    @rishiraj2548 Год назад +1

    🙏💯

  • @saurabhsuradkar1626
    @saurabhsuradkar1626 Год назад

    consumer is not able to receive msg or connect to broker

  • @VINOTHCH
    @VINOTHCH 11 месяцев назад

    @javatechie i need your help to complete a work. it is very urgent i'm subscribing a topic and i need to interpret the topic message and save it dynamodb

    • @Javatechie
      @Javatechie  11 месяцев назад

      Are you using SQS ?

    • @VINOTHCH
      @VINOTHCH 11 месяцев назад

      @@Javatechie I’m using Kafka

  • @Derrick-f8m
    @Derrick-f8m Год назад

    The GOAT

  • @aces8481
    @aces8481 8 месяцев назад

    bro zoom in lol the text is tiny at times