Spring Boot with Spring Kafka Consumer Example | Tech Primers

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 126

  • @brunofilgueiras3518
    @brunofilgueiras3518 5 ปีที่แล้ว +8

    had zero understanding of Kafka on a coding level now it looks much clearer thanks buddy...

  • @AlessandroModica
    @AlessandroModica 2 ปีที่แล้ว +1

    Wow fantastic! Very easy and understable explanation and I know now the right route to envelope a basic consumer that read and manage a set of data that producer (a backend ad example) send on topic after , ad example, a classic query search request with, ad example, rest request . Now I will try to reply this example and next I will find noctions to set a simple listener springboot producer to send resultset by consumer client. This is my objective now. Thanks

  • @afjungle
    @afjungle 2 ปีที่แล้ว +1

    Thank you so much for this tutorial, bro, very helpful.

  • @amebaos
    @amebaos 4 ปีที่แล้ว +1

    Super tutorial to get started with kafka

  • @mahendraprasad800
    @mahendraprasad800 3 ปีที่แล้ว +1

    very very very very good tutorial

  • @photo_lab4095
    @photo_lab4095 4 ปีที่แล้ว +2

    Very helpful in real-time project. If possible could please make videos on Kafka Stream

  • @semicoder198
    @semicoder198 ปีที่แล้ว

    Thank you for this video. This was really helpful and saved a lot of time. Clear explanation along with the issues we will run into. Keep up the good work!!

  • @subhagsharan6480
    @subhagsharan6480 3 ปีที่แล้ว +1

    Thanks...clear example

  • @SameeraSenarathna
    @SameeraSenarathna 5 ปีที่แล้ว +1

    On of the good video on Kafka real world example . Keep doing the great work

  • @SK-xs1vz
    @SK-xs1vz 4 ปีที่แล้ว +1

    Very nice tutorial. Can you please make a video on kafka producer and consumer that use ssl sasl with kerberos for security.

  • @linknys
    @linknys 4 ปีที่แล้ว +2

    If it doesn't wotk, try to copy it in your POM.XML in :
    com.fasterxml.jackson.core
    jackson-databind
    com.fasterxml.jackson.core
    jackson-core
    com.fasterxml.jackson.core
    jackson-annotations
    Have a good one!

  • @venugopalkabra1724
    @venugopalkabra1724 3 ปีที่แล้ว

    Nice and very informative video.. Request you to also please share a video on how to create zoo keeper/kafka/producer/listener using command line which you are continously using during your video. Thanks for this video..

  • @didierroque7248
    @didierroque7248 4 ปีที่แล้ว +3

    Nice tutorials @Tech Primers! But please notice that Spring Boot allows us to avoid all the boilerplate code that we introduce creating a Java class annotated with @Configuration. You can use application properties / application.yml (also using properties is easier than declaring your own beans). Here it is an example: github.com/didorg/kafka-consumer
    Cheers... & excellent videos!

    • @afjungle
      @afjungle 2 ปีที่แล้ว

      Nice short cut, bro. please, how do we configure the producer using the same approach?

  • @SohailKhan-gu2du
    @SohailKhan-gu2du 3 ปีที่แล้ว

    Hey man.... U r very knowledgeable.. Can u create some. Complex apps... Using spring boot.. Kafka.. Multi threading n all.... Like handling huge traffics of request... Apart from this simple crud apps

  • @pradeekmohandas4234
    @pradeekmohandas4234 4 ปีที่แล้ว +3

    simple and clear. Thanks!

  • @asdfasdfasdfasdf219
    @asdfasdfasdfasdf219 2 ปีที่แล้ว

    Nice tutorial. Do you know how to consume it using the concurrent consumer pattern (Multiple consumer instances)?

  • @jcrshankar
    @jcrshankar 3 ปีที่แล้ว

    Hi please create video for catching exception like broker down or timeout or any unhandled exception using spring clould handlers...without dlq..

  • @Srini8174
    @Srini8174 4 ปีที่แล้ว +1

    Thank you for clear explanation

  • @sandythandu
    @sandythandu 3 ปีที่แล้ว +1

    Awesome tutorial.

  • @LucasCastroOliveira
    @LucasCastroOliveira 6 ปีที่แล้ว +1

    Congratulations on your tutorial. Very informative to get started. Could you provide an example when Kafka throws a Deserialization error: eg. when an invalid json is produced and delivered.

  • @geekgeeks2256
    @geekgeeks2256 6 ปีที่แล้ว +3

    1st comment and 1st view..Loving ur videos man..Thank you..

  • @muditagarwal8569
    @muditagarwal8569 3 ปีที่แล้ว +1

    Simple and best.

  • @paladivenkatakrishna7227
    @paladivenkatakrishna7227 3 ปีที่แล้ว

    For the same can u do one video regarding same to be stored in cassandra database or any other

  • @LearnwithRV
    @LearnwithRV 5 ปีที่แล้ว +4

    Nice tutorials. I've got a question though: Why did you separate the producer example and the consumer one in separated projects? It's because you applied a "microservices" pattern? Thanks!

    • @AlfranAli
      @AlfranAli 4 ปีที่แล้ว

      Thinking about the same! +1

    • @dzmitrykapachou4513
      @dzmitrykapachou4513 3 ปีที่แล้ว +1

      because from the code perspective consumer and producer might be developed by various independent teams. So they define the contract to communicate and start implementation by their own

  • @pavanim6258
    @pavanim6258 3 ปีที่แล้ว

    Thanks for the nice session..it's very crisp and clear..one doubt..if our consumer needs to read from multiple topics with diff schemas,can we use same listener?

  • @manukumarkm9304
    @manukumarkm9304 3 ปีที่แล้ว

    Simple and Clean .

  • @smritiverma8990
    @smritiverma8990 3 ปีที่แล้ว

    Please also add an example on Avro kafka spring boot

  • @sivakaranb7265
    @sivakaranb7265 4 ปีที่แล้ว

    Thanks for making the video, I have doubt in the KafkaConsumer class. Why u didn't specify any containerfactory in kafkalistener when u consumed string message? But you specified it when you consumed json message. Thanks in advance

  • @Rajkumar-ge2xd
    @Rajkumar-ge2xd 4 ปีที่แล้ว

    Hi, Can you also make video to set the security for kafka consumers and producing?

  • @sauravbhagat4737
    @sauravbhagat4737 4 ปีที่แล้ว

    Can you please post videos on unit testing or integration testing these real-time codes? Thanks for all these videos

  • @normansiboro7483
    @normansiboro7483 6 ปีที่แล้ว +1

    Thank you for your tutorial. it is really helpful.
    But, I have one question regarding the consumer..
    is it possible to consume the data like list of entity (e.x List in your demo)
    I have tried that but nothing works on my own

  • @amilcarrojas417
    @amilcarrojas417 5 ปีที่แล้ว

    Thaaaank u sooo much. I'm new with Kakfa, in my work it's being used... You helped a lot ;)

  • @vikasmatcha442
    @vikasmatcha442 4 ปีที่แล้ว

    Can you explain for connecting to all partitions ( dynamic ) when using kafka listener ?

  • @prashantraghav8040
    @prashantraghav8040 5 ปีที่แล้ว

    Hi , very nice video and thanks for GitHub link , I am facing issue with running my Kafka installation on windows

  • @savacano2858
    @savacano2858 3 ปีที่แล้ว +1

    Simple et clear! ty!!!

  • @harivittalhk
    @harivittalhk 4 ปีที่แล้ว

    Good video.Do we need to control the listener explicitly using the KafkaEndpointListener registry if we want to pause the listener if needed. Also on restart of the application, how the consumer can read the messages sent when it's down. Is it based on the offset config (latest?)

  • @yuriihizun7183
    @yuriihizun7183 6 ปีที่แล้ว +1

    Goooood video. Maybe you will make video about configuration Kafka && Zookeper like in real world app?

  • @abidinberkay1
    @abidinberkay1 4 ปีที่แล้ว

    firstly thanks for this great concise video. What I wonder is that do we have to create separate consumer and listener factories for each different type of object or is there a way to make a common factory that maps to corresponding object ?

  • @narasimhangopinath1559
    @narasimhangopinath1559 6 ปีที่แล้ว +2

    Hi, Thanks for the video. Can you please explain a scenario where multiple kafka partitions are required? Also i want to know if the message still exists in the cluster even after the clients have consumed it. If so when will it be cleared?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว +1

      multiple partitions are useful when you want to publish a specific pattern of messages on to a partition and the consuming process can be different based on partition. the purge policy of the data is configured in the Kafkacluster

  • @tanmoychowdhury2
    @tanmoychowdhury2 5 ปีที่แล้ว

    Thank you for the content.In this example broker host name in configuration is hard coded. For multi broker cluster what should we pass ?

  • @SpiritOfIndiaaa
    @SpiritOfIndiaaa 5 ปีที่แล้ว

    Really good ... is there any vid on kafaka offSet management and partitioning samples ?

  • @tapaswinimohanty9494
    @tapaswinimohanty9494 6 ปีที่แล้ว +1

    Nice Video.Will you please create more videos on Kafka or JMS?

  • @muks
    @muks 6 ปีที่แล้ว +1

    Very Nice tutorial. Thanks

  • @ashokjena1319
    @ashokjena1319 4 ปีที่แล้ว

    Hii can i cosume message from multiple different topic with one listiner Or one cosumer method

  • @a_l_o_k_1991
    @a_l_o_k_1991 6 ปีที่แล้ว +1

    Very helpful tutorial !! where kafka stores data? Is it kind of db as well?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      Its stored in the filesystem.

  • @pranshushrivastava20
    @pranshushrivastava20 6 ปีที่แล้ว

    can you please create a video of using camel with kafka also how to handle the message delivery failure with retry logic

  • @steambassador
    @steambassador 4 ปีที่แล้ว +2

    Nice tutorial! thank you...

  • @jidnyasanade3317
    @jidnyasanade3317 4 ปีที่แล้ว +1

    You are amazing 👍

  • @大盗江南
    @大盗江南 4 ปีที่แล้ว +1

    thank u buddy! amazing job!

  • @manashranjan1267
    @manashranjan1267 4 ปีที่แล้ว

    Please use white colour background in STS other wise it will create headache

  • @vutony4282
    @vutony4282 4 ปีที่แล้ว

    Thanks for this tutorial

  • @shivakumarn7963
    @shivakumarn7963 3 ปีที่แล้ว

    Song was Flix and Chill 2 : Millenials

  • @aayushkc2306
    @aayushkc2306 4 ปีที่แล้ว

    can you make a video how to use spring-data-jpa with mysql and apache kafka ... fetching the data from mysql using my spring data and showing that data into view and also the chatting system. I want the view with a real time ...

  • @peanuteats
    @peanuteats 4 ปีที่แล้ว

    Hi any idea on how to read Kafka messages on interval bases ? Like I want to read messages every 5 min once..

  • @karan6551
    @karan6551 3 ปีที่แล้ว +1

    Awesome ❤️🔥❤️🔥❤️❤️❤️❤️❤️

  • @rrafaelpaz
    @rrafaelpaz 4 ปีที่แล้ว

    Great explanation and example! Cheers mate!

  • @vikramreddy7586
    @vikramreddy7586 5 ปีที่แล้ว

    Do we need to predefine the topics name in the @KafkaListener annotation ? What if I have 100 topics and over the period of time the topic names may grow, how do we handle this scenario ?

  • @thisisarandomstring
    @thisisarandomstring 5 ปีที่แล้ว

    A little finding in regards to the no default constructor error: Alternatively you can use @JsonCreator to annotate the parameterized constructor so that a redundant default constructor can be saved. This way it'll be helpful to keep the immutability of the User class should you decide to make it so later on.

  • @merts4376
    @merts4376 5 ปีที่แล้ว +2

    good tutorial wasnt expecting

  • @koreolagh
    @koreolagh 6 ปีที่แล้ว

    Thanks . How can create deserializer for all model ?

  • @gurubirajdar2627
    @gurubirajdar2627 4 ปีที่แล้ว

    Hi, how can set up Kafka on local windows 10 system?

  • @lucasbezerra3450
    @lucasbezerra3450 6 ปีที่แล้ว +2

    Hello. I would like to know if I can have both consumer and producer in a springboot application?

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      Yes Lucas. You can have both

    • @lucasbezerra3450
      @lucasbezerra3450 6 ปีที่แล้ว +1

      Hi. I have created an application with both and it worked. Do you intend to create a tutorial about integrating avro schemas to kafka. Thank you for your tutorial it helped me to figure out about the kafka integration on srping boot.

  • @shaktiprasadrath
    @shaktiprasadrath 5 ปีที่แล้ว

    Do you know how to configure Json deserializer through application properties file rather then configuring in java??

  • @kubraozer6674
    @kubraozer6674 4 ปีที่แล้ว

    I can not consume the messages any way . I controlled group id, topic name, everywhere. But my kafkaListener is not working ? Do you have any idea about that?

  • @PrateekMehtaABDFAN
    @PrateekMehtaABDFAN 2 ปีที่แล้ว

    Why concurrentKafkaTemplate in consumer and not in publisher ?

  • @umeshbsss
    @umeshbsss 4 ปีที่แล้ว +1

    Hi,
    Is it possible to create listener to kafka topic dynamically to read. And then destroy it based on some condition.
    Thanks,

    • @TechPrimers
      @TechPrimers  4 ปีที่แล้ว

      never did it dynamically. i assume its possible with spring, but you may have to understand how the listeners are initialized and registered in spring internally

  • @VijayKumar-qf9rp
    @VijayKumar-qf9rp 4 ปีที่แล้ว

    thanks bro

  • @reeshabhchoudhary5112
    @reeshabhchoudhary5112 3 ปีที่แล้ว +1

    Can the previous producer and current consumer work in tandem?

    • @TechPrimers
      @TechPrimers  3 ปีที่แล้ว +1

      Yes buddy. It does

  • @iTzWunderkind
    @iTzWunderkind 5 ปีที่แล้ว +1

    Big Thanks

  • @pranavpatil8072
    @pranavpatil8072 4 ปีที่แล้ว

    I am getting an error
    Error while fetching metadata with correlation id : {exampletopic= UNKNOWN_TOPIC_OR_PARTITION}
    I have verified that the topic is present
    can you please help ?

  • @李哲-i2r
    @李哲-i2r 4 ปีที่แล้ว +1

    thank you

  • @samantr
    @samantr 5 ปีที่แล้ว +1

    @20:10 Any reason why the consumer is showing the json in single quotes as compared to the producer message being sent in double quotes
    ?

    • @satyad87
      @satyad87 4 ปีที่แล้ว +1

      That is deserialized message to object and displayed by toString which is hardcoded with single quote

  • @LearnwithRV
    @LearnwithRV 5 ปีที่แล้ว

    Hello, I have a question. Why did we started a consumer when we created the producer spring boot app and now we're starting a producer when this tutorial is about a consumer app?

    • @AlfranAli
      @AlfranAli 4 ปีที่แล้ว

      He started consumer because he wanted to check weather his code of producer spring boot app which is sending messages to topic are weather able to be received by the consumer or not and vice-versa! :)

  • @Rishi_Ventrapati
    @Rishi_Ventrapati 5 ปีที่แล้ว +1

    I followed this tutorial and try to a consumer a message from the command line to my spring boot application.
    i'm not receivng any message
    but it's working in consumer CLI

    • @passone
      @passone 4 ปีที่แล้ว

      same here, did you ever figure out what the issue was?

  • @jayak4489
    @jayak4489 4 ปีที่แล้ว

    Hi, I do not follow why the group id is defined twice, discussion 7:10. One time it is for the consumer and one time for the Configuration. If the two group ids are different say group_1 for the config factory and group_2 for the consumer, what impact would it have on message consumption. Would it work or that both the values have to be the same. If same then why ?

    • @AlfranAli
      @AlfranAli 4 ปีที่แล้ว

      In config we are creating a group with the specified group ID say group_1, now in consumer we are using that group with the corresponding group ID which is group_1. If you want to use group_2 in consumer than you should also have a group with the corresponding ID to be configured.

  • @bihardesk8892
    @bihardesk8892 3 ปีที่แล้ว

    Hi ,I need to create topic ,but I do not have Kafka in my system, I have created springboot microservice using gpscaffold ,in that I added consumer Kafka ,but now I need to create topic but I am got confused ,where I could create that

    • @TechPrimers
      @TechPrimers  3 ปีที่แล้ว

      You have to setup kafka buddy. Check kafka getting started documentation

  • @bhoomikagajpal674
    @bhoomikagajpal674 4 ปีที่แล้ว

    Hi, I'm getting User{name='null', dept='null'} printed, can you please help debug this?

  • @dpraveenk38
    @dpraveenk38 5 ปีที่แล้ว

    Bro, your intro music is lit. Any link?

  • @suneelkumar-ry8dj
    @suneelkumar-ry8dj 6 ปีที่แล้ว

    How can we create consumer listeners dynamically per topic?

  • @RahulSingh-ex2sm
    @RahulSingh-ex2sm 5 ปีที่แล้ว +1

    Awesome Man!

  • @atul4bits180
    @atul4bits180 5 ปีที่แล้ว +2

    pretty good, thanks

  • @BrijeshPatel-cd4yd
    @BrijeshPatel-cd4yd 6 ปีที่แล้ว

    Can u make a video on how to integrate a web application with paytm.

  • @vivekmishra1487
    @vivekmishra1487 6 ปีที่แล้ว +1

    Great videos......sir

  • @laxmichandra4904
    @laxmichandra4904 5 ปีที่แล้ว +1

    cloud you please share kafka publish video

    • @TechPrimers
      @TechPrimers  5 ปีที่แล้ว

      Here you go th-cam.com/video/NjHYWEV_E_o/w-d-xo.html

  • @thumarmitesh6559
    @thumarmitesh6559 4 ปีที่แล้ว

    I didn't understand how did you create the producer !!!

    • @TechPrimers
      @TechPrimers  4 ปีที่แล้ว

      That's a command line based producer. You can check my other video on Kafka producer to see how it can be done via code

  • @GauravSharma-wb9se
    @GauravSharma-wb9se 4 ปีที่แล้ว

    I am getting error while starting application...... In kafka server terminal it shows error related to api key is 3 and api version is 2.
    I am not getting solution for it.

  • @vikasmatcha442
    @vikasmatcha442 4 ปีที่แล้ว

    How to commit offset after receiving each message

  • @ashishsengar87
    @ashishsengar87 6 ปีที่แล้ว

    I tried with only the jason listner but it is showing me error no bean found
    Parameter 1 of method kafkaListenerContainerFactory in org.springframework.boot.autoconfigure.kafka.KafkaAnnotationDrivenConfiguration required a bean of type 'org.springframework.kafka.core.ConsumerFactory' that could not be found.
    - Bean method 'kafkaConsumerFactory' in 'KafkaAutoConfiguration' not loaded because @ConditionalOnMissingBean (types: org.springframework.kafka.core.ConsumerFactory; SearchStrategy: all) found bean 'userConsumerFactory'

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      Looks like you missed an annotation. Can you cross check with my code in GitHub

  • @anishakim9006
    @anishakim9006 6 ปีที่แล้ว

    how can consumer receive messages if he connected late plz help ( afte the message was send from the producer )

    • @TechPrimers
      @TechPrimers  6 ปีที่แล้ว

      thats done using the offsets in Kafka

  • @TheBezszelestny
    @TheBezszelestny 3 ปีที่แล้ว

    Nice movie

  • @SaratKumar-qk7lu
    @SaratKumar-qk7lu 3 ปีที่แล้ว

    Hi Tech Primers, for Example. we are using the User. So, we created a new Consumer factory. I have 20 models. I need to create 20 consumer factories or is there any solution. Could you please guide me to get that?

  • @coffeewithjava5625
    @coffeewithjava5625 6 ปีที่แล้ว +1

    OSM

  • @rajneeraj8247
    @rajneeraj8247 5 ปีที่แล้ว

    getting error:
    org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition
    dont know why is coming and going in loop. Anyone please help .

  • @kaushikghosh3751
    @kaushikghosh3751 5 ปีที่แล้ว

    Hi i tried both the publisher and the consumer steps mentioned here as two different springboot application. i could publish the msg easily but while trying to consume teh message i am getting the below error
    org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition kafka_example-0 at offset 1. If needed, please seek past the record to continue consumption.
    Caused by: java.lang.IllegalArgumentException: The class 'com.aexp.dbkafka.entity.ClientUserDTO' is not in the trusted packages: [java.util, java.lang, com.aexp.kafkaconsumer.bean]. If you believe this class is safe to deserialize, please provide its name. If the serialization is only done by a trusted source, you can also enable trust all (*).
    Note that for the object in the publisher application is com.aexp.dbkafka.entity.ClientUserDTO while in consumer application it is com.aexp.kafkaconsumer.bean.
    How should i solve this ?

    • @shobhitmittal77
      @shobhitmittal77 4 ปีที่แล้ว

      Hi Kaushik, even I am getting the same error, did you manage to solve it..

  • @Shmelele1
    @Shmelele1 3 ปีที่แล้ว

    хороший индус

  • @GURUKHAN_OG
    @GURUKHAN_OG 4 ปีที่แล้ว

    Am I the only one who is looking for the part where he explains how to install Kafka?

  • @nickrazrazilov
    @nickrazrazilov 4 ปีที่แล้ว

    Kafka without SSL is not Kafka

  • @Shmelele1
    @Shmelele1 3 ปีที่แล้ว

    индус

  • @sexysurd007
    @sexysurd007 6 ปีที่แล้ว +1

    Awesome tutorial on Kafka 👍

  • @kkkbuta5
    @kkkbuta5 4 ปีที่แล้ว

    I'm quite sure the server.port=8081 is not used here. check the kafka producer video and you will see how the line is meant to be used.