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

preview_player
Показать описание
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

Рекомендации по теме
Комментарии
Автор

Спасибо огромное!!!! Ты очень хорошо все объясняешь.👍👍👍👍

УмарКаригов
Автор

many thanks about your tutorial, cuz your video i very help for learning about kafka

wahyuusman
Автор

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.

krishnamadhav
Автор

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".

johnbrooks
Автор

Some of the windows commands are not working for me giving "The syntax for the command is incorrect" specially when using --from-beginning

anshikamishra
Автор

Hi, I am getting 405 request method not supported, but I can’t understand why, anyone can help me?

arthurmukelyan
Автор

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 ?

meduriravindra
Автор

How to consume data by using browser or postman?

pavanraju
Автор

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 Can't convert value of class to class specified in value.serializer] with root cause java.lang.ClassCastException: class cannot be cast to class java.lang.String 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

elakkiyap
Автор

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.

adityakendhe
Автор

Replace your KafkaConsumer class code with the below code if you are getting :- Can't convert value of class com.vinay.kafka.payload.User to class

public class KafkaConsumer {

@KafkaListener(topics = "nepdroid", groupId = "myGroup")
public void consume(User user) {
received -> %s", user.toString()));
}
}

MDAnashAnsari
Автор

Anyone please help me to resolve this error Can't convert value of class com.vinay.kafka.payload.User to class

vinay