Spring Boot with Spring Kafka Consumer Example | Tech Primers

Поделиться
HTML-код
  • Опубликовано: 5 окт 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

  • @photo_lab4095
    @photo_lab4095 4 года назад +2

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

  • @amebaos
    @amebaos 4 года назад +1

    Super tutorial to get started with kafka

  • @SameeraSenarathna
    @SameeraSenarathna 5 лет назад +1

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

  • @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..

  • @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!!

  • @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.

  • @mahendraprasad800
    @mahendraprasad800 3 года назад +1

    very very very very good tutorial

  • @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?

  • @afjungle
    @afjungle 2 года назад +1

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

  • @subhagsharan6480
    @subhagsharan6480 3 года назад +1

    Thanks...clear example

  • @sauravbhagat4737
    @sauravbhagat4737 4 года назад

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

  • @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.

  • @asdfasdfasdfasdf219
    @asdfasdfasdfasdf219 2 года назад

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

  • @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

  • @Srini8174
    @Srini8174 4 года назад +1

    Thank you for clear explanation

  • @prashantraghav8040
    @prashantraghav8040 5 лет назад

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

  • @Rajkumar-ge2xd
    @Rajkumar-ge2xd 4 года назад

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

  • @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

  • @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!

  • @yuriihizun7183
    @yuriihizun7183 6 лет назад +1

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

  • @amilcarrojas417
    @amilcarrojas417 5 лет назад

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

  • @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?

  • @smritiverma8990
    @smritiverma8990 3 года назад

    Please also add an example on Avro kafka spring boot

  • @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.

  • @pradeekmohandas4234
    @pradeekmohandas4234 4 года назад +3

    simple and clear. Thanks!

  • @sandythandu
    @sandythandu 3 года назад +1

    Awesome tutorial.

  • @manukumarkm9304
    @manukumarkm9304 3 года назад

    Simple and Clean .

  • @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..

  • @muditagarwal8569
    @muditagarwal8569 3 года назад +1

    Simple and best.

  • @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

  • @tapaswinimohanty9494
    @tapaswinimohanty9494 6 лет назад +1

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

  • @vikasmatcha442
    @vikasmatcha442 4 года назад

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

  • @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

  • @paladivenkatakrishna7227
    @paladivenkatakrishna7227 3 года назад

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

  • @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

  • @savacano2858
    @savacano2858 3 года назад +1

    Simple et clear! ty!!!

  • @SpiritOfIndiaaa
    @SpiritOfIndiaaa 5 лет назад

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

  • @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 ?

  • @rrafaelpaz
    @rrafaelpaz 4 года назад

    Great explanation and example! Cheers mate!

  • @muks
    @muks 6 лет назад +1

    Very Nice tutorial. Thanks

  • @manashranjan1267
    @manashranjan1267 4 года назад

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

  • @steambassador
    @steambassador 4 года назад +2

    Nice tutorial! thank you...

  • @大盗江南
    @大盗江南 4 года назад +1

    thank u buddy! amazing job!

  • @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?

  • @jidnyasanade3317
    @jidnyasanade3317 4 года назад +1

    You are amazing 👍

  • @shivakumarn7963
    @shivakumarn7963 3 года назад

    Song was Flix and Chill 2 : Millenials

  • @geekgeeks2256
    @geekgeeks2256 6 лет назад +3

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

  • @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 ...

  • @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?)

  • @merts4376
    @merts4376 5 лет назад +2

    good tutorial wasnt expecting

  • @ashokjena1319
    @ashokjena1319 4 года назад

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

  • @vutony4282
    @vutony4282 4 года назад

    Thanks for this tutorial

  • @karan6551
    @karan6551 3 года назад +1

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

  • @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?

  • @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..

  • @PrateekMehtaABDFAN
    @PrateekMehtaABDFAN 2 года назад

    Why concurrentKafkaTemplate in consumer and not in publisher ?

  • @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.

  • @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

  • @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 ?

  • @reeshabhchoudhary5112
    @reeshabhchoudhary5112 3 года назад +1

    Can the previous producer and current consumer work in tandem?

  • @dpraveenk38
    @dpraveenk38 5 лет назад

    Bro, your intro music is lit. Any link?

  • @RahulSingh-ex2sm
    @RahulSingh-ex2sm 5 лет назад +1

    Awesome Man!

  • @iTzWunderkind
    @iTzWunderkind 5 лет назад +1

    Big Thanks

  • @李哲-i2r
    @李哲-i2r 4 года назад +1

    thank you

  • @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

  • @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 ?

  • @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?

  • @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?

  • @vivekmishra1487
    @vivekmishra1487 6 лет назад +1

    Great videos......sir

  • @laxmichandra4904
    @laxmichandra4904 5 лет назад +1

    cloud you please share kafka publish video

    • @TechPrimers
      @TechPrimers  5 лет назад

      Here you go ruclips.net/video/NjHYWEV_E_o/видео.html

  • @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.

  • @BrijeshPatel-cd4yd
    @BrijeshPatel-cd4yd 6 лет назад

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

  • @atul4bits180
    @atul4bits180 5 лет назад +2

    pretty good, thanks

  • @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! :)

  • @vikasmatcha442
    @vikasmatcha442 4 года назад

    How to commit offset after receiving each message

  • @shaktiprasadrath
    @shaktiprasadrath 5 лет назад

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

  • @suneelkumar-ry8dj
    @suneelkumar-ry8dj 6 лет назад

    How can we create consumer listeners dynamically per topic?

  • @bhoomikagajpal674
    @bhoomikagajpal674 4 года назад

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

  • @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.

  • @VijayKumar-qf9rp
    @VijayKumar-qf9rp 4 года назад

    thanks bro

  • @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

  • @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

  • @rajneeraj8247
    @rajneeraj8247 5 лет назад +1

    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 .

  • @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

  • @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

  • @coffeewithjava5625
    @coffeewithjava5625 5 лет назад +1

    OSM

  • @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..

  • @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?

  • @TheBezszelestny
    @TheBezszelestny 3 года назад

    Nice movie

  • @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 года назад

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

  • @Shmelele1
    @Shmelele1 3 года назад

    индус

  • @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.

  • @sexysurd007
    @sexysurd007 6 лет назад +1

    Awesome tutorial on Kafka 👍