Spring Boot + Apache Kafka Tutorial - #12 - Create REST API to Send JSON Object

  Рет қаралды 47,415

Java Guides

Java Guides

Күн бұрын

Welcome to Spring Boot + Apache Kafka Tutorial series.
In this lecture, we will create a REST API to send a JSON message in request. The REST API intern converts JSON into a User object and sends it to Kafka Producer. Kafka Producer intern sends that user object to Kafka topic.
#springboot #kafka #javaguides
Complete playlist at • Spring Boot + Apache K...
GitHub link: github.com/Ram...

Пікірлер: 33
@УмарКаригов
@УмарКаригов Жыл бұрын
Спасибо огромное!!!! Ты очень хорошо все объясняешь.👍👍👍👍
@wahyuusman6777
@wahyuusman6777 Жыл бұрын
many thanks about your tutorial, cuz your video i very help for learning about kafka
@Longdevdn
@Longdevdn Жыл бұрын
Nice presentation and explanation.
@JavaGuides
@JavaGuides Жыл бұрын
Glad you liked it!
@Andrzej3935
@Andrzej3935 Жыл бұрын
Greate lessons
@krishnamadhav7639
@krishnamadhav7639 10 ай бұрын
At 2:07, you have added PostMapping("/publish") and in the previous video in MessageController class you have added GetMapping("/publish"). Can you please explain the reason behind it? Please clarify this. As per my understanding at both the places it should be GetMapping annotation only.
@johnbrooks8839
@johnbrooks8839 Жыл бұрын
Those who are getting the error trying to cast your User object to a String may need to update your producer properties to have a key serializer and value serializer instead of "deserializer".
@krishnasarkar252
@krishnasarkar252 Жыл бұрын
I have added this but still got same error
@buddy6670
@buddy6670 3 ай бұрын
@@krishnasarkar252 for me it was syntax error
@shailendraraj4951
@shailendraraj4951 2 жыл бұрын
great explanation
@anshikamishra5938
@anshikamishra5938 Жыл бұрын
Some of the windows commands are not working for me giving "The syntax for the command is incorrect" specially when using --from-beginning
@arthurmukelyan404
@arthurmukelyan404 10 ай бұрын
Hi, I am getting 405 request method not supported, but I can’t understand why, anyone can help me?
@meduriravindra4238
@meduriravindra4238 2 жыл бұрын
Please explain how to consume old data from Kafka after the old data get updated. Is it a possible scenario atleast from interview point of view ?
@adityakendhe5630
@adityakendhe5630 2 жыл бұрын
hello sir, I am getting null pointer exception related to kafka template while using rest api to send json object on console. And in postman it is showing internal server error. please help.
@PeaFootballer
@PeaFootballer 2 жыл бұрын
I am getting the same error too did u get solution?
@adityakendhe5630
@adityakendhe5630 2 жыл бұрын
@@PeaFootballer my code is correct...so i guess its due to some of the libraries or dependencies missing on our IDE unlike used in lecture. In better way i skipped it and and continued with lecture. in next lecture he made real time project. Thats important.
@lky100047
@lky100047 2 жыл бұрын
add import org.apache.kafka.common.serialization.StringSerializer; import org.springframework.kafka.support.serializer.JsonSerializer; to every java class work for me
@poojagamskar6872
@poojagamskar6872 2 жыл бұрын
recheck the previous learning vedio u must have missed creating constructor for kafka template,so u r getting null pointer exception
@elakkiyap5509
@elakkiyap5509 Жыл бұрын
hai sir. i tried to send Json Message to kafka topic but am getting internal server error in postman . As well as in intellij, ERROR [dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.kafka.common.errors.SerializationException: Can't convert value of class in.inspired.services.model.User to class org.apache.kafka.common.serialization.StringSerializer specified in value.serializer] with root cause java.lang.ClassCastException: class in.inspired.services.model.User cannot be cast to class java.lang.String (in.inspired.services.model.User is in unnamed module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')...how to overcome this error. kindly help in this
@newtanagmukhopadhyay4716
@newtanagmukhopadhyay4716 Жыл бұрын
did you resolve it?
@elakkiyap5509
@elakkiyap5509 Жыл бұрын
@@newtanagmukhopadhyay4716 yes sir. i resolved it. however thank you for your presence to help me.
@newtanagmukhopadhyay4716
@newtanagmukhopadhyay4716 Жыл бұрын
@@elakkiyap5509 ah dont call me sir pls its embrassing for me. im just 22
@elakkiyap5509
@elakkiyap5509 Жыл бұрын
@@newtanagmukhopadhyay4716oh. Am sorry.
@divyanshukumar5460
@divyanshukumar5460 Жыл бұрын
Even I am getting this error, can u please help me to resolve this
@pavanraju6485
@pavanraju6485 2 жыл бұрын
How to consume data by using browser or postman?
@MDAnashAnsari
@MDAnashAnsari Жыл бұрын
Replace your KafkaConsumer class code with the below code if you are getting :- org.apache.kafka.common.errors.SerializationException: Can't convert value of class com.vinay.kafka.payload.User to class org.apache.kafka.common.serialization.StringSerializer public class KafkaConsumer { @KafkaListener(topics = "nepdroid", groupId = "myGroup") public void consume(User user) { log.info(String.format("Message received -> %s", user.toString())); } }
@vinay2841
@vinay2841 2 жыл бұрын
Anyone please help me to resolve this error org.apache.kafka.common.errors.SerializationException: Can't convert value of class com.vinay.kafka.payload.User to class org.apache.kafka.common.serialization.StringSerializer
@shanmugamsekar2070
@shanmugamsekar2070 Жыл бұрын
i also get this error
@vinay2841
@vinay2841 Жыл бұрын
@@shanmugamsekar2070 Have u got a solution?
@sanyamkharche6646
@sanyamkharche6646 Жыл бұрын
@@vinay2841 To ensure that the User class is properly serialized and deserialized as JSON, you need to add the necessary Jackson annotations.e.g. @JsonProperty annotation. Add this dependency in your pom.xml if using a spring boot project. com.fasterxml.jackson.core jackson-databind
How To Call a REST API In Java - Simple Tutorial
29:14
Coding with John
Рет қаралды 296 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Java Spring Boot REST API JSON Response Handling Tutorial with Demonstration
17:34
#15 Spring Web Http methods GET and POST
20:55
Telusko
Рет қаралды 48 М.
Apache KAFKA Tutorial | KAFKA Crash Course | Spring Boot
56:49
Daily Code Buffer
Рет қаралды 111 М.
Learn JSON files in 10 minutes! 📄
10:09
Bro Code
Рет қаралды 74 М.