Spring Boot with Spring Kafka Consumer Example | Tech Primers

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 126

  • @brunofilgueiras3518
    @brunofilgueiras3518 6 років тому +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

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

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

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

  • @photo_lab4095
    @photo_lab4095 4 роки тому +2

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

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

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

  • @SK-xs1vz
    @SK-xs1vz 5 років тому +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

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

  • @sauravbhagat4737
    @sauravbhagat4737 4 роки тому

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

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

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

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

  • @paladivenkatakrishna7227
    @paladivenkatakrishna7227 3 роки тому

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

  • @pradeekmohandas4234
    @pradeekmohandas4234 4 роки тому +3

    simple and clear. Thanks!

  • @Rajkumar-ge2xd
    @Rajkumar-ge2xd 4 роки тому

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

  • @subhagsharan6480
    @subhagsharan6480 3 роки тому +1

    Thanks...clear example

  • @vikasmatcha442
    @vikasmatcha442 4 роки тому

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

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

  • @sandythandu
    @sandythandu 3 роки тому +1

    Awesome tutorial.

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

  • @geekgeeks2256
    @geekgeeks2256 6 років тому +3

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

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

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

  • @roque.didier
    @roque.didier 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?

  • @amilcarrojas417
    @amilcarrojas417 5 років тому

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

  • @smritiverma8990
    @smritiverma8990 3 роки тому

    Please also add an example on Avro kafka spring boot

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

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

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

  • @Srini8174
    @Srini8174 4 роки тому +1

    Thank you for clear explanation

  • @SpiritOfIndiaaa
    @SpiritOfIndiaaa 5 років тому

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

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

  • @sivakaranb7265
    @sivakaranb7265 5 років тому

    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

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

  • @rrafaelpaz
    @rrafaelpaz 5 років тому

    Great explanation and example! Cheers mate!

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

  • @manukumarkm9304
    @manukumarkm9304 4 роки тому

    Simple and Clean .

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

  • @muditagarwal8569
    @muditagarwal8569 3 роки тому +1

    Simple and best.

  • @prashantraghav8040
    @prashantraghav8040 6 років тому

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

  • @muks
    @muks 6 років тому +1

    Very Nice tutorial. Thanks

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

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

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

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

  • @tapaswinimohanty9494
    @tapaswinimohanty9494 6 років тому +1

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

  • @savacano2858
    @savacano2858 3 роки тому +1

    Simple et clear! ty!!!

  • @yuriihizun7183
    @yuriihizun7183 6 років тому +1

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

  • @gurubirajdar2627
    @gurubirajdar2627 4 роки тому

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

  • @manashranjan1267
    @manashranjan1267 4 роки тому

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

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

  • @karan6551
    @karan6551 3 роки тому +1

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

  • @steambassador
    @steambassador 4 роки тому +2

    Nice tutorial! thank you...

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

  • @shivakumarn7963
    @shivakumarn7963 4 роки тому

    Song was Flix and Chill 2 : Millenials

  • @大盗江南
    @大盗江南 4 роки тому +1

    thank u buddy! amazing job!

  • @jidnyasanade3317
    @jidnyasanade3317 4 роки тому +1

    You are amazing 👍

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

    Why concurrentKafkaTemplate in consumer and not in publisher ?

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

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

  • @bhoomikagajpal674
    @bhoomikagajpal674 4 роки тому

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

  • @GauravSharma-wb9se
    @GauravSharma-wb9se 5 років тому

    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.

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

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

  • @reeshabhchoudhary5112
    @reeshabhchoudhary5112 3 роки тому +1

    Can the previous producer and current consumer work in tandem?

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

  • @koreolagh
    @koreolagh 6 років тому

    Thanks . How can create deserializer for all model ?

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

  • @vutony4282
    @vutony4282 4 роки тому

    Thanks for this tutorial

  • @timadeshola
    @timadeshola 6 років тому

    Can we have multiple group id on one consumer config. method ?

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

  • @suneelkumar-ry8dj
    @suneelkumar-ry8dj 6 років тому

    How can we create consumer listeners dynamically per topic?

  • @RahulSingh-ex2sm
    @RahulSingh-ex2sm 5 років тому +1

    Awesome Man!

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

  • @dpraveenk38
    @dpraveenk38 5 років тому

    Bro, your intro music is lit. Any link?

  • @vivekmishra1487
    @vivekmishra1487 6 років тому +1

    Great videos......sir

  • @laxmichandra4904
    @laxmichandra4904 5 років тому +1

    cloud you please share kafka publish video

    • @TechPrimers
      @TechPrimers  5 років тому

      Here you go ua-cam.com/video/NjHYWEV_E_o/v-deo.html

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

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

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

  • @BrijeshPatel-cd4yd
    @BrijeshPatel-cd4yd 6 років тому

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

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

  • @atul4bits180
    @atul4bits180 5 років тому +2

    pretty good, thanks

  • @iTzWunderkind
    @iTzWunderkind 5 років тому +1

    Big Thanks

  • @VijayKumar-qf9rp
    @VijayKumar-qf9rp 4 роки тому

    thanks bro

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

  • @jhonceenaskt
    @jhonceenaskt 5 років тому

    Thank you

  • @GURUKHAN_OG
    @GURUKHAN_OG 4 роки тому

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

  • @TheBezszelestny
    @TheBezszelestny 4 роки тому

    Nice movie

  • @coffeewithjava5625
    @coffeewithjava5625 6 років тому +1

    OSM

  • @nickrazrazilov
    @nickrazrazilov 4 роки тому

    Kafka without SSL is not Kafka

  • @Shmelele1
    @Shmelele1 3 роки тому

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

  • @Shmelele1
    @Shmelele1 3 роки тому

    индус

  • @shaktiprasadrath
    @shaktiprasadrath 5 років тому

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

  • @李哲-i2r
    @李哲-i2r 4 роки тому +1

    thank you