Kafka Implementation with Producer and Consumer example in Spring boot | tutorial | Code Decode

Поділитися
Вставка
  • Опубліковано 19 сер 2024
  • In this video of kafka implementation with producer and consumer example by code decode we have explained
    Udemy Course of Code Decode on Microservice k8s AWS CICD link:
    openinapp.co/u...
    Course Description Video :
    yt.openinapp.c...
    Introduction to kafka : • Kafka tutorial for Beg...
    Kafka Architecture : • Apache Kafka Key Termi...
    Github link : github.com/cod...
    Link to download Kafka : kafka.apache.o...
    Commands to start Zookeeper and Kafka :
    .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
    .\bin\windows\kafka-server-start.bat .\config\server.properties
    Kafka implementation with producer and consumer is very important topic with interview point of view.
    What is Kafka
    Apache Kafka is publish-subscribe based fault tolerant messaging system. It is fast, scalable and distributed by design.
    It was initially thought of as a message queue and open-sourced by LinkedIn in 2011. Its community evolved Kafka to provide key capabilities:
    Publish and Subscribe to streams of records, like a message queue.
    Storage system so messages can be consumed asynchronously. Kafka writes data to a scalable disk structure and replicates for fault-tolerance. Producers can wait for write acknowledgments.
    Stream processing with Kafka Streams API, enables complex aggregations or joins of input streams onto an output stream of processed data.
    Traditional messaging models are queue and publish-subscribe. In a queue, each record goes to one consumer. In publish-subscribe, the record is received by all consumers.
    Pros of Kafka
    Loose coupling - Neither service knows about each other regarding data update matters.
    Durability - Guarantees that the message will be delivered even if the consumer service is down. Whenever the consumer gets up again, all messages will be there.
    Scalability - Since the messages get stored in a bucket, there is no need to wait for responses. We create asynchronous communication between all services.
    Flexibility - The sender of a message has no idea who is going to consume it. Meaning you can easily add new consumers (new functionality) with less work.
    Cons of Kafka
    Semantics - The developer needs to have a deep understanding of the message flow as its strict requirements. Complex fallback approaches may take place.
    Message Visibility - You must track all those messages to allow you to debug whenever a problem occurs. Correlation IDs may be an option.
    Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
    Advance Java Interview Questions and Answers : • Advance Java Interview...
    Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
    Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
    Spring Boot Interview Questions and Answers : • Advance Java Interview...
    Angular Playlist : • Angular Course Introdu...
    SQL Playlist : • SQL Interview Question...
    GIT : • GIT
    Subscriber and Follow Code Decode
    Subscriber Code Decode : www.youtube.co...
    LinkedIn : / codedecodeyoutube
    Instagram : / codedecode25
    #kafka #codedecode #kakfainterviewquestions

КОМЕНТАРІ • 179

  • @kanishkkumar8272
    @kanishkkumar8272 Рік тому +50

    Thankyou so so so much for this. I saw this video just before my interview and cracked the interview. Kafka was asked for 20 minutes. Really, thanks a lot. Got a hike of 160 percent . Interviewer was so impressed by the answers. Thank you once again. Really appreciate it. Please never stop these.

    • @CodeDecode
      @CodeDecode  Рік тому +4

      Many congratulations Kanishk. Well deserved Man 👍👍🎊🎊🎊 keep learning keep shining👏👏

    • @syedaqib2912
      @syedaqib2912 Рік тому

      Congrats man !!

    • @prerna3404
      @prerna3404 Рік тому

      Which company?

  • @johnnybreathe
    @johnnybreathe 2 роки тому +7

    Thanks for the implementation. I have done synchronous microservices till now. It's totally new concept to learn asynchronous also. 🧑‍💻 Thank you so much. And please continue what ever is important these days and in coming future as a java developer. 🤗 TQ for the videos

  • @GauravSharma-up9gs
    @GauravSharma-up9gs Рік тому +4

    Thanks for simplifying everything at one place.
    One day you must go famous for your videos in your playlist of your channel.

    • @CodeDecode
      @CodeDecode  Рік тому +1

      🙏🙏thanks a lot for these beautiful words Gaurav. These comments means a lot to us. It keeps us motivated to upload more content 🙏🙏🙂

  • @fakruu
    @fakruu 2 роки тому +1

    The best video beginner friendly video on kafka + spring boot !

  • @ajitpeshane8311
    @ajitpeshane8311 5 місяців тому

    very simplified and working poc on kafka,
    Thank you so much.
    In my case i struggled while executing the command @ 12.06 minutes
    error: The input line is too long. The syntax of the command is incorrect.
    Solution: I have renamed the folder to kafka and moved that to D drive directly. worked for me.
    Might help others.

  • @kasperamkumar5489
    @kasperamkumar5489 Рік тому +1

    I didn't went through this video bcoz your videos always rockzz I will go through all your video in a few days.
    All the best 👍

    • @CodeDecode
      @CodeDecode  Рік тому

      Hehe sure 👍👍 keep learning keep shining Man👍👍👍👍

  • @chetankhandave1072
    @chetankhandave1072 Рік тому +1

    It's my humble request, please make a playlist for Apache Kafka, so that we can go through each video one by one. It will be very easy for every one.
    And again you have done a fantastic job. Thank you so much.

    • @CodeDecode
      @CodeDecode  Рік тому

      We have one Chetan : ua-cam.com/play/PLyHJZXNdCXset6tBB1aY5aEY77YhbxWLo.html

    • @CodeDecode
      @CodeDecode  Рік тому

      We will add more videos to this playlist 👍

    • @chetankhandave1072
      @chetankhandave1072 Рік тому

      @@CodeDecode Thank you so much for your reply. It will be very useful for every one of us.

    • @chetankhandave1072
      @chetankhandave1072 Рік тому

      @@CodeDecode In this example, consumer and producer are in this same application, but what if Consumer is in one application and producer in another application ? How can we handle it ?

  • @SampritiChowdhury-m8m
    @SampritiChowdhury-m8m 20 днів тому

    Extreme Helpful and helped me to give a valuable KT -session to all my colleagues and make a worthful presentation of it . Thanks a lot mam for boosting Confidence .😇

  • @nitinvnk3975
    @nitinvnk3975 3 місяці тому +1

    Simple, Crisp and to the point thank you for this content.

  • @user-ez2jc4uz2f
    @user-ez2jc4uz2f 6 місяців тому +1

    This was very helping in completing my assignments. Looking forward for more basic video. Thanks much.

    • @CodeDecode
      @CodeDecode  5 місяців тому

      Sure we will create more soon

  • @PranitKothari
    @PranitKothari Рік тому +1

    Wow! Awesome. This can't be explained any better, this can't be explained easier.

  • @joshinim.n9863
    @joshinim.n9863 2 роки тому +3

    Thank you so much for this series of videos. I feel so grateful for it. This is so useful. You're really imparting great knowledge in people!

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks joshini for the nice words

  • @ankitgiri6874
    @ankitgiri6874 Рік тому +1

    Thanks you so much for all of your videos, The way you explain, every concept becomes very easy to understand.

  • @ithisrinu9593
    @ithisrinu9593 9 місяців тому +1

    you are best among all you tuber channels tq madam

  • @sheiksahil7209
    @sheiksahil7209 2 роки тому +5

    Great video...loved the way you explained .... Please make a series on Event-Driven Microservices concepts also. Thank you in Advance.

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      Sure Sahil. 👍🙂 thanks for the nice suggestion

  • @pranjalsingh1099
    @pranjalsingh1099 2 роки тому +1

    Thanks for up to the point explanation. Please continue this series to for explanation of individual components.

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks Pranjal. Sure 👍🙂

  • @sreeramsarath5188
    @sreeramsarath5188 Рік тому +1

    It's very good and way of telling so .. easy to understand.

  • @aman_deep21
    @aman_deep21 Рік тому +1

    Very nice demo for getting started with Kafka, thank you

  • @bhaumikpatel5932
    @bhaumikpatel5932 2 роки тому +1

    Thanks for explaining apache Kafka. Please upload more videos on kafka streams and interview questions

    • @CodeDecode
      @CodeDecode  2 роки тому

      sure bhaumik we will create it soon

  • @surpriser2292
    @surpriser2292 6 місяців тому

    Can you please continue the series and provide more information regarding the Kafka Architecture. Kudos for all the efforts in compiling such great video.

  • @rishisharma3569
    @rishisharma3569 2 роки тому +1

    Please please please continue this series. I have subscribed and liked and shared.

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      Thanks Rishi. 🙂sure we will continue this series

  • @PankhuriSinghChauhan-vr9se
    @PankhuriSinghChauhan-vr9se 11 місяців тому +1

    Loved the explanantion.. clear and crisp. Thank you :)

  • @AshishYadav-se4db
    @AshishYadav-se4db 2 роки тому +1

    Thank you so much for creating Kafka video 😊,and explanation is amazing 🔥.

  • @sourabhjinde8191
    @sourabhjinde8191 2 роки тому +1

    Thanks for the detailed video 🙏. Please continue with the architecture video

    • @CodeDecode
      @CodeDecode  2 роки тому

      Sure thanks Sourabh 🙂👍

  • @tanveersyed1049
    @tanveersyed1049 2 роки тому +2

    Thank u so much for uploading one more kafka video

  • @lukemagnotta6823
    @lukemagnotta6823 Рік тому +1

    How Eloquently was the explanation!

  • @gudiya1491
    @gudiya1491 Рік тому +1

    You are a very good teacher i would say 😊, really..very well explained i was struggling with this kafka topic from so long thanks for providing this video.. earlier i watched exception handler ,i understood everything in one go , didn't watch any other videos to understand it better ...can you please provide videos on bamboo and veracode...also aws🙏

  • @aishurajas2507
    @aishurajas2507 4 місяці тому

    Thanks alot to you and your fabulous content for java developers! God bless you

  • @dipaliyadav-koli1060
    @dipaliyadav-koli1060 2 роки тому +1

    Thanks for your hard work on this.. As usual best explanation.. ❤️❤️❤️

  • @karamjitsinghsehdev3451
    @karamjitsinghsehdev3451 Рік тому +1

    Nice and Simple. Please try to make real scenario based videos also for experienced. That will help crack interviews. Thankyou.

    • @CodeDecode
      @CodeDecode  Рік тому

      Next is too implement kafka in microservices application

  • @karthikeyanrm3446
    @karthikeyanrm3446 2 роки тому +2

    Please continue this series. If possible make a series on Event driven Microservices. Not sure if you remember - but I have been asking for so long to cover centralized logging, API gateway, Distributed tracing, ELK, docker-kubernetes also (all companies expect this) and then atlast deploy into cloud - AWS/Azure.

    • @CodeDecode
      @CodeDecode  2 роки тому

      Yeah all in pipeline Karthikeyan 🙂

    • @karthikeyanrm3446
      @karthikeyanrm3446 2 роки тому

      @@CodeDecode thank you so much. Please do. You guys are awesome 😊

  • @bpani
    @bpani 3 місяці тому +1

    Great session mam, thank you!

  • @shrutik1863
    @shrutik1863 2 роки тому +1

    Thanks for the video. Please continue series

    • @CodeDecode
      @CodeDecode  2 роки тому

      Sure Thanks Shruti👍🙂

  • @vengateshm2122
    @vengateshm2122 2 роки тому +2

    Very informative hands on tutorial.

  • @akashsaha9366
    @akashsaha9366 2 роки тому +3

    Thanks maam, for the great explanation

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks Akash 🙂🙂👍👍

  • @lohir446
    @lohir446 2 роки тому +2

    Very useful concept 👌 keep doing

    • @CodeDecode
      @CodeDecode  2 роки тому

      Thanks a lot ☺ And thanks for the previous comment too 😊

  • @sagarsonawane3888
    @sagarsonawane3888 2 роки тому +1

    Thanks, very helpful video to understand kafka messaging

  • @jayjoshi1366
    @jayjoshi1366 Рік тому

    It is always worth learning from your videos and this Kafka implementation was really nice one which is even more than MQ. Kindly create next part as well where we can learn about asynchronous communication between multiple micro services. Thanks!

  • @siddharthpandey835
    @siddharthpandey835 Рік тому +1

    Super! continue more videos on Kafka.

  • @user-sapdev
    @user-sapdev Рік тому

    Thank you so much for for your great efforts and time for getting this content in a simple and clear way. It would be great and useful if you can continue the series..advanced topics like kafka stream API as well.. Thanks once again for your continuous efforts

  • @umamaheswarreddy9204
    @umamaheswarreddy9204 2 роки тому +1

    i loved your energy , TQ for the video. 😊

  • @user-cu5pf4yo8c
    @user-cu5pf4yo8c 7 місяців тому +1

    Great content covered and Im ready to work my Jira story

  • @aayanksinghai8242
    @aayanksinghai8242 Рік тому +1

    Very Well Explained! Thank you

  • @AnuragTripathiShiva
    @AnuragTripathiShiva Рік тому +1

    I have little doubt when you say - “broker is a topic” and “consumer will subscribe to broker”.
    It conflicts with my understanding that broker is not a topic instead it is a kind of container which have multiple partitions from different topics.
    And consumer subscribes to topic rather than the broker.
    Please correct me if I am wrong.

  • @RishavKumar28
    @RishavKumar28 2 роки тому +1

    Very well explained!! Please make videos on streams too. Thanks.

    • @CodeDecode
      @CodeDecode  2 роки тому

      sure we will create it soon

  • @Sedhu_17
    @Sedhu_17 Рік тому

    Yes mam we need kafka streams tutorial

  • @siddhilalabobo3597
    @siddhilalabobo3597 2 роки тому +1

    Excellent video for beginners,

  • @rahultripathi1602
    @rahultripathi1602 10 місяців тому

    please make Kafka Streams video too and if possible Interview questions video too. Thanks!

  • @mukulmangla632
    @mukulmangla632 2 роки тому +1

    nice video.. please continue this series. Also can you talk about offset and streams and taking a more complex and practical example

    • @CodeDecode
      @CodeDecode  2 роки тому

      True. Real beauty of kafka is in streams 👍

    • @mukulmangla632
      @mukulmangla632 2 роки тому

      yes but can also explain offset please

  • @jatinkumarsingh4414
    @jatinkumarsingh4414 Рік тому +1

    Great video!!

  • @charanm4871
    @charanm4871 Рік тому +1

    Thank you so much, this video helps a lot.

  • @priyangapinki5715
    @priyangapinki5715 4 місяці тому

    Thank you so much. Can you please implement kafka with your vaccination center and citizen project. It will be helpful for understanding real time projects

  • @puneetgahlot3556
    @puneetgahlot3556 2 роки тому +1

    Superb , Wooww amazing.

  • @unemployedcse3514
    @unemployedcse3514 9 місяців тому +1

    Awesome 😍

  • @cheshvikaraj7769
    @cheshvikaraj7769 Рік тому +1

    nice Explanation. Thank you

  • @chetankhandave1072
    @chetankhandave1072 Рік тому +1

    In this example, consumer and producer are in this same application, but what if Consumer is in one application and producer in another application ? How can we handle it ?

  • @geethufrancis6988
    @geethufrancis6988 Рік тому +1

    Ma'm Thank you soooo much for this playlist. Can you please create a video on setting the kafka messages to Redis db...

  • @sureshkamble1526
    @sureshkamble1526 2 роки тому +2

    Initially title was "KAKA" suddenly wonderd ☺

    • @CodeDecode
      @CodeDecode  2 роки тому

      🙊our bad. Sorry that was typo 🙊

  • @dipeekadeshmukh263
    @dipeekadeshmukh263 6 місяців тому

    zookeper and kafka both are not running, giving an error as The input line is too long and The syntax of the command is incorrect.

  • @DhruvSharmax
    @DhruvSharmax Рік тому +1

    Can you please let us know how to handle objects instead of string as message. Also how to use kafka streams.

  • @rahulkhot3290
    @rahulkhot3290 Місяць тому

    Thanks for this Nice Video. I could not find the video for kafka streams, could you please let me know the link

  • @resikas.b.5511
    @resikas.b.5511 3 місяці тому +1

    you have to create a topic in the terminal. That is not shown in the video

  • @bhavyar4983
    @bhavyar4983 Рік тому

    Hi mam plz do cover the interview questions
    thanks a lot for ur time

  • @kalyanimvn
    @kalyanimvn Рік тому +1

    U r rocking mam.asm

  • @vidhiagarwal9370
    @vidhiagarwal9370 4 місяці тому

    But how to get kafka communicate in different microservices? Would this work? because I see you have done the communication in the same service

  • @ourworldofknowledge5542
    @ourworldofknowledge5542 2 роки тому +1

    Excellent video

  • @nikhilpawar7876
    @nikhilpawar7876 Рік тому +1

    awesome

  • @abdulrehaman4462
    @abdulrehaman4462 8 місяців тому

    am facing problem in running zookeeper server , input is too long ,syntax error .... what should i do...

  • @sayanbiswas8847
    @sayanbiswas8847 2 роки тому +2

    Helpful

  • @kanchankatkar5226
    @kanchankatkar5226 5 місяців тому

    When will be next video of which you said in last in video, please do keep posting

  • @MrGoodLuck
    @MrGoodLuck 11 місяців тому

    Mam can you show using docker also? 🤔I tried searching for it but playlist doesn’t have that and also can you please make a video nd explain if I am using okta then how to authenticate only once for all the services 😅or any other method is also fine like how will we apply security for it I have seen the okta video but wanted to know how it will be done in microservices architecture

  • @atulpatil7472
    @atulpatil7472 Рік тому

    Thanks for this wonderful video..I was practicing this code and able to consume my message..after all message consumed. I stop kafka and zookeeper server .once again I have started both server and I am again getting same messages in my consumer. How we can avoid that , as I have already read it before and don't want to read it again as it's duplicate for me

  • @Ammupopproductions
    @Ammupopproductions Рік тому +1

    Please create kafka streams video also

  • @deepsarandeepu
    @deepsarandeepu Рік тому

    Installing kafka and Zookeeper means, Just downloading it from the URL mentioned ?, Some one can explain ?

  • @akshayvishwanath2591
    @akshayvishwanath2591 7 місяців тому

    Crazy❤

  • @UmmakaJagadish
    @UmmakaJagadish 2 роки тому +1

    madam please do more videos on microservices

  • @doctorag1135
    @doctorag1135 Рік тому

    I am getting error group id is not found in exceptation, SO group id can be custom any thing hardcode right?

  • @Brainvenus
    @Brainvenus 28 днів тому

    Good

  • @giridharkumar8176
    @giridharkumar8176 Рік тому

    I know this is a basic demo, but I have a question, here you did not create topic inside kafka cluster, and no where you added your topic name in any properties file that is being used in two commands u ran in cmd, u added in ur application's properties file but not in kafka application or zookeeper aplication, so then in enterprise application, any one can create as many topic as they want as it does not required kafka broker permission, so how to restrict it then?

  • @user-zg8wv5qb7m
    @user-zg8wv5qb7m 7 місяців тому

    MA'm, i a getting logs in infinite loop in console

  • @souvikasus2903
    @souvikasus2903 Рік тому

    I am unable to Install Kafka binary. tgz file in my windows 11. Please help me out.

  • @venki1437
    @venki1437 2 роки тому +1

    Hai medam,
    Could please create one video on how to work with jsonb type data in postgress and how to integrate that data with spring boot jpa like how to insert jsonb data in Db using jpa create entity class store data in Db retrieve data from db.
    Note : there is no videos on UA-cam related this concept ,could you Create ASAP. it is helpful to programers

    • @sivareddy50
      @sivareddy50 2 роки тому

      Nice question, please do a video on jpa concept

  • @nareshk329
    @nareshk329 2 роки тому

    Please attach PPT as well for information purpose or notes to remember.

  • @abhishekchaudhari2344
    @abhishekchaudhari2344 Рік тому

    Can plz you clear why consumer not require deserializer there? when we use deserializer in Consumer?

  • @priyanktiwary1067
    @priyanktiwary1067 2 роки тому +1

    Please post video on rabbit mq implementation also

  • @abhinavgoel4358
    @abhinavgoel4358 2 роки тому

    Can you please explain serialisation and deserialisation in Java with practical example

  • @prateetisingha6729
    @prateetisingha6729 2 роки тому

    Hi , thank you for your videos it's realy helps a lots. Is it possible to share some videos regarding cicd pipeline.

    • @CodeDecode
      @CodeDecode  2 роки тому

      sure we will upload it soon

  • @start1learn-n171
    @start1learn-n171 5 місяців тому

    Tq

  • @pradeepgupta2089
    @pradeepgupta2089 Місяць тому

    Partition key is missing in sample code

  • @agusp1951
    @agusp1951 Рік тому +1

    What about JsonSerializer or CustomSerializer

    • @CodeDecode
      @CodeDecode  11 місяців тому

      We will add them in playlist soon 👍

  • @satishsali5571
    @satishsali5571 Рік тому

    Can you give the link of Kafka with Stream video?

  • @mash6066
    @mash6066 2 роки тому +1

    Hi sister,
    I have one doubt .
    In springboot
    In service class
    for saving books we will use
    @Autowired
    Bookrepository br ;
    We will use
    br.save();
    Bookrepository is an interface
    Can u explain ,how it will work .
    @Autowired we will use for object creation
    But here Bookrepository is an interface

    • @mash6066
      @mash6066 2 роки тому

      I have already commented , regarding this sister

    • @CodeDecode
      @CodeDecode  2 роки тому

      This interface must extend some existing interface right? It calls internal api to save your data to db

  • @smehta344
    @smehta344 2 роки тому +1

    Hi, I have one question
    In one interview they asked me
    What is the Kafka consumer group name?
    Please can you help me with this question.

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      Already gave an example in demo Sanjeev. What I can think of is consumer id here. We can have multiple consumer insame group by giving common group id/ name

    • @smehta344
      @smehta344 2 роки тому +1

      @@CodeDecode thanks

    • @CodeDecode
      @CodeDecode  2 роки тому

      🙂👍

  • @hamedhamed-ox9ty
    @hamedhamed-ox9ty Рік тому

    How to get job as Kafka admin can any one tell me only learning Kafka administration will give job?

  • @TummalapalliTejaswini
    @TummalapalliTejaswini Рік тому

    I am getting error can anyone help me

  • @letsthink1490
    @letsthink1490 2 роки тому +2

    Dear please change the title of this video.i really thought KAKA IS a new concept in java😅😅😅😅

    • @CodeDecode
      @CodeDecode  2 роки тому +1

      Ohh really thanks for letting us know. 😆it was a typo🙊

  • @rishiraj2548
    @rishiraj2548 Рік тому +1

    🙏👍👍

  • @padmalankipalli593
    @padmalankipalli593 2 роки тому +1

    Thank you so much @codedecode

  • @22ankitajaiswal
    @22ankitajaiswal Рік тому

    Hello codeDecode team, I am getting error when I am doing the implementation by following the video. The error is:
    Unexpected error in InitProducerIdResponse; The request is timed out. or.apache.kafja.common.KafkaException

  • @varunb2453
    @varunb2453 2 роки тому +1

    Hi, Can you please videos on @KafkaHandler. thanks