Spring Cloud Stream With Apache Kafka Binder | Example | JavaTechie

Поділитися
Вставка
  • Опубліковано 4 лют 2025
  • This video will guide you How to build highly scalable event-driven microservices connected with shared messaging systems using Kafka Binder
    #javatechie #SpringCloud #ApacheKafka #kafkaStream
    GitHub:
    github.com/Jav...
    Blogs:
    / javatechie
    Facebook:
    / 919464521471923
    guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
    Disclaimer/Policy:
    --------------------------------
    Note : All uploaded content in this channel is mine and its not copied from any community , you are free to use source code from above mentioned GitHub account

КОМЕНТАРІ • 159

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

    Basant thank you. You are a Genius and a very technical and kind person.

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

    This is really awesome.
    I just have created similar producer-consumer. Which use to produce data as an object using Kafka which required lots of configuration at both side.
    With Spring Cloud Stream we have specified almost null configuration.

  • @kamalshaik1266
    @kamalshaik1266 3 роки тому +3

    what a relief, struggling to understand these, thank you so much , excellent explanation, :-),

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

    Simply super, nice videos 👍👌

  • @Ani-qd6nm
    @Ani-qd6nm 5 років тому +5

    Awesome ...Thank you for sharing your precious knowledge with us.

  • @sumontapoddar9342
    @sumontapoddar9342 3 роки тому +3

    Great tutorial with so well explanation. Thank you for making such kind of tutorial.

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

    Very helpful tutorial, you are doing great work, keep it up...

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

    Awesome explanation..thank you
    2 question faced in interview for kafka/Rabbit Mq:
    1) how to avoid duplicate message to be consumed in consumer? .
    2) how to handel if topic is full of messages?

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

    The content you showcase is amazing and really good to understand thank you sir

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

    At last my doubts Clarified.... Tq a lot

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

    Excellent Bro..👍

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

    Awesome . Very clean explanation. Thank you Bro🙏

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

    Superb, very easy way explained and good to remember me this concept. please make video on kafka vs rabbitmq and with use case.

  • @mayanksrkumar16
    @mayanksrkumar16 Рік тому +2

    Very informative. Could you also make a video on data transfer using avro instead of json. Also some use case where multiple input and output topics are involved would be great. Thanks.

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

    Excellent explanation as always sir..!

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

    Extremely helpful for beginners, thanks

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

    Quality video tutorial. Just curious to know which software you are using for screen recording and which device you are using for voice recording.

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

    God Bless You.

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

    nicely explained, very helpful

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

    Excellent .

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

    Thank you so much 🎉🎉🎉

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

    Thank you. This is quite detailed.

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

      Hi @Java Techie, I have a specific question. Lets assume that for some reason, your consumer application was down. How would you know that the message sent through the message bus (kafka) has not been consumed and how do you mitigate around that?

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

      It doesn't matter whether your consumer is up or not once message received to topic , whenever your consumer will listen to it immediately he will receive events

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

      @@Javatechie, thank you. I will check this out.

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

    Clear and concise explanation! Thanks!

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

    Awesome

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

    Thank you, I was wondering how spring boot and kafka are related.

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

    Well explained.Thank you for this explanation

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

    awesome broo.. waiting for this tutorial.. clear explanation

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

    Hello @Basant, Thanks for posting such an informative video in great detail in a simple way.
    Just one small doubt, When the consumer was down initially, your first request from producer should have parked to the topic (18:39), but was not reflected when the consumer was up (18:55). Did we lose the message published initially, consumer should automatically have picked up the message when started which is parked at 18:39? Please guide.

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

      Consumer should automatically pick-up when back to online buddy

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

    Great video.. Thank you !!!

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

    Hi Java Techie, your all videos are worth trying. Could you please make a video on recent spring cloud stream (3.1.3) with Kafka because certain annotations which you have used like EnableBinding, StreamListener are deprecated .

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

      Hi Asha , definitely I will try with update one

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

      @@Javatechie Dear, Thanks a lot for amazing kafka videos, it would be too good if you make a video as per above request.

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

      @@subhrajeetpadhy sure buddy will do this

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

    Very Informative . Can you show how to configure multiple bindings is a same service .

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

      Yes will definitely try

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

      @@Javatechie Can you also show a case where a Sink/Consumer can also publish to another topic after it is done processing? Great video!

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

    Very useful videos, Where to add kafka properties.

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

    kindly do a video on spring cloud streams with supplier, function and consumer

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

    Hi Basant,
    I like to watch your all youtube videos.
    I have a recommendation for you and it will be quick and easy -
    Can you please dockerize these projects? (current video)
    producer consumer of apache kafka with spring cloud on DOCKER??
    On Windows OS(please)

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

    You created topic in Kafka, and I belive Kafka is running on some port. How publisher and subscriber is communicating with Kafka server to produce/consume from topic, we did not provided any configuration from producer/consumer side?

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

    Amazing and very helpful, thanks so much... it's just superb. I would like to achieve exactly the samething but using docker in stead of running localy. Do you have a tutorial that explores something of that nature?

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

    Hi @EnableBinding is deprecated , can u please let us know what is the alternative we can use.

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

    Thanks for accepting my request

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

    Thanks for this. It's a shame the @EnableBinding is already deprecated and there is no documentation on referring to "@deprecated as of 3.1 in favor of functional programming model". Doesn't seem to be many reliable resources to go from this.

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

      did u find out how to replace it?

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

      @Bean(name = "input")
      Function uppercase() {
      return in -> new Transformer(in, in.toUpperCase());
      }// it will read from topic input-in-0 and perform transformation and publish to input-out-0 topic // no configurations needed in properties file or Java class

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

    Thank you :)

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

    Thanks for the video, if possible make an example with RabbitMq also, so that we can differentiate easily

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

    Nice video . i have one question here. if I need to use more than one object to consume. how can i do it? .

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

      Publish list of object in source and consume list from sink

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

    Hi @Basant Nice presentation and I am trying to do the same .But consumer is not listening to the message .I haven't added the iml file .Is there any reason not printing statement in those method

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

      Sink annotation is there ?

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

      @@Javatechie yes .streanlistener(Sink.input) and enabled bindings for class and annotated with component.not showing errors but not entering to that method

  • @AbhimanyuKumar-wc1ws
    @AbhimanyuKumar-wc1ws 5 років тому

    Thanks..Can you share video how can configure multiple brokers...

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

    @Enablebinding is deprecated now.What is the alternative for this?I want to build a kafka consumer in spring boot.What are the options?

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

    We didn't mentioned here the kafka IP and host details, that also done required with the binder?

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

      It's not required that's what the beauty of spring cloud stream. Based on your binder spring cloud is smart enough to identify what messaging channel you are using

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

      I really respect you sir.
      You always reply on comments thanks.
      What if Kafka server is on different server and application on different?

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

      Then you need to configure bootstrap server details buddy but again that is one go solution

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

    Sir, pieces other than the binder looks tightly coupled. In a real time scenario, we expect innumerous back and forth interactions between the microservices. Configuring one way messaging channeling seems quite expensive from development standpoint. Could you please suggest an alternative solution offering a balanced approach?

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

    Hi Basant,
    I have a question. On How do we get the data from a topic in a consumer application?

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

      Usually we should get in the form of JSON string

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

      @@Javatechie ok. how to read the data in the topic and respond/provide it in a REST API. ?

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

      Please check out my Kafka producer and consumer example

  • @ss-ih7zh
    @ss-ih7zh 4 роки тому +1

    Bro you used spring cloud stream but not Kstream. Isn't it necessary to implement kstream while working with cloud stream.
    Streaming is done using Streams right ?

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

      Hi Satya ,
      May I know purpose of using kstream here ?

    • @ss-ih7zh
      @ss-ih7zh 4 роки тому

      I'm new to kafka .i implemented your video but when i started to read kafka streams everything code is done creating by using kstream.that why i was asking

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

    nice one . can we configure multiple topic channel in consumer side ?

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

      Yes we can

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

      @@Javatechie can you please give some sample code for this . i have some requirements..

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

      @@Javatechie can you please give your contact details.

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

    Hi Nice explanation, I am new to Spring cloud stream concept. I have one doubt i.e. can we use same input chaneel with more than one streamLinsters. Please clarify.

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

      You can use but one of the running application will read the message

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

    If we don't add source in binding in publisher whether consumer will not work ?? or if message already published by some one else and if I'm writing consumer with sink binding will i able to receive the message ??

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

      Your first question how consumer will consume the message if you won't publish it
      Source -- publisher
      Sink -- Consumer

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

    If possible make video on kafka async produce and consume, it helps us alot.

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

    Is there any specific reason we have to create application.yml while we already have application.properties? Can't we specify the bindings inside application.properties ?

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

      It's upto you ☺️ .I feel good to use application.yml

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

    Hi,
    In my project I am using spring cloud stream binder and azure event hub as broker.
    Everything works well for means able to publish the event.
    But when I tried to load test the producer using Jmeter, let's say for 1000 threads,app publishes some random number of events to event hub and after that it is throwing Emissions exception with message like doNext or doError must be signaled serially.
    Any idea on this.

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

      Haven't tried with cloud messing queue Budd will check and update

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

    Getting this error when running producer while passing data through postman : Failed to convert message: 'GenericMessage [payload=com.creator.cloud.stream.api.model.....Can you help as there is a change in spring version I guess?

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

    Hi, You might have forgot to link Apache kafka link in Description.

  • @SumitKumar-lj3nd
    @SumitKumar-lj3nd 2 роки тому +1

    Where do we specify the kafka server details (host,port) this needs to connect

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

      Not required spring cloud will identify it based on binder you added in your pom

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

    Hope this is same for STS? Instead of yml we can use application.properties as I am not clear why you require both files

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

      Yes we can use only one no issues

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

    If we have 2 producer in one service and 2 consumer in another service thenhow will it work

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

      You need to define those info in application.yml bindings section

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

      @@Javatechie Thanks for your answer but can you share example.

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

    Hi. Is it possible to show an example with manmual acknowledge functionality along with some other custom configurations just like Kafka consumer. I am not able to find any refrence.

  • @abhishekraj-kf3zc
    @abhishekraj-kf3zc 4 роки тому +1

    how to configure kafka..if it is an aws kafka(MSK)..do we need to use msk url in bootstrap_server_config ?

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

      Hi Abhishek am not sure , I believe we should use AWS provide messing queue like sqs

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

    Hello java Techie, Can you give explain also if kakfa is on other server and producer and consumer are on other server, I think we need to define configuration somewhere then so that prodcer and consumer can send message through that server

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

      Yes both are running in different .
      We could separate with 2 different application to understand it better way

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

    any reference for remote partitioning using Spring cloud stream ?

  • @138OM
    @138OM 4 роки тому

    whrere you are specifying broker details of kafka?

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

    Can we define multiple topics in the yml file. If we can then How can we choose specific topic with channel.

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

    Tried this IDE not working with spring boot but for your it's working like anything,is there any video for this?

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

      It will work add spring assistant plugin on it .

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

      @@Javatechie tried this way bro if failed for recently IDE version 2020.2 think,working version please?

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

      I was using 2019.3

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

      @@Javatechie thanks bro,installed same version and spring assistant plugin as well am getting spring initializr option but again autocomplete not coming for application.yml

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

      Can we connect in google meet javatechie4u@gmail.com .
      It looks Some configuration problem

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

    What if we want to publish data on multiple topic from 1 microservice to multiple micro services from multiple controller, can we deploy kafka server on kubernates pods. Could you please explain the same using GCP pub/sub with multiple topics. And also how can we assured that the subscriber had execute for that payload, does we get any acknowledge id ? and can we see the unacknowledges messages in kafka server which are not passed to subscriber(consumer) ?
    And with the GCP i have faced the problem using PUB/SUB as until acknowledge come its executing the same message and in my code due to some error its never returning the ack due that the same message executed continuously please help me as i am not configure the pub/sub in my company
    appreciate if we can discuss over the google meets, Thanks

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

    If you create a seperate class for publisher instead of putting publisher logic in main, do you have to annotate the @EnableBinding(Source.class) on main class or the publisher class?

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

      You need to add both Source and sink in @EnableBinding

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

    Hi bro .. m trying to follow your code
    But here .. @EnableBinding has been deprecated .. so is there any alternative way ..pls suggest

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

      I didn't check update version

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

    If we have more than one controller in publishers and more than one consumer method how it will execute it's Respective consumer method

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

      In consumer we are using stream listener right so you need to specify channel name

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

    `@StreamListener` is deprecated now.

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

    How to configure consumer service for multiple topics and group?

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

    Where do we add broker details which is running remotely.

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

    Where do we mention the kafka server running ip and port?

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

    Can you make a video to integrate kafka with spring boot microservice architecture on kubernetes?

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

      I am not much aware about kunernates

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

      @@Javatechie No problem! Please keep making great videos on Java Concepts! :)

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

      Yes Lau I will do

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

    How can we use db

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

    Can we bind source and sink class in the same application?

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

      I have one more doubt like how to configure multiple topics in producer and consumer

  • @Anil-Pochiraju
    @Anil-Pochiraju 4 роки тому +1

    Is github link for this application accessible? I am not able to access it. Can someone share the working github link for this application

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

      Yes it's public repository everyone can access .
      Login to GitHub then try to access it

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

    please post the producer error handling methodologies with DLQ

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

    Please video on rabitmq with UI, thanks

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

    Sir can you tell how to retrieve the data from to two different services at a time please.

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

      Hi Yogesh , Are you trying this using rest API call ?

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

      @@Javatechie yes I am trying rest api

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

    How to configure more than one destination topics

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

    Kinda weird to see using Lombok without @Log or smth when u need logger

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

    Could you explain what is cloud pubsub?

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

      I never tried this, will check and let you know

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

    are you working only with java?

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

    Please help me on this , I have 2 methods with separate api call and both are consuming the same topic. when I publish data, only first method is calling, 2nd is not calling. what I need to do.- Sample code:
    @StreamListener("inputchannel")
    public void consumeMessage(String message){}
    @StreamListener("inputchannel")
    public void consumeMessage2(String message){}

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

    Awesome

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

    Very nicely explained. Thank you