Recently, I try to make a web application(java and spring platform) . In the server side, I want to process the servlet request in a asynchronous way.
And I want to try using Rabbit MQ to implement this. But when I am working on it, I find it's difficult to send a HttpServletRequst object to rabbitmq.
My message convert is Jackson2JsonMessageConverter.
And below is my produce code
public void sendDataToQueue(String queueKey, Object msgObj){
try{
amqpTemplate.convertAndSend(queueKey, msgObj);
} catch (Exception e) {
e.printStackTrace();
}
}
Does anyone have idea about it ?
Is it appropriate to use RabbitMQ here to process asynchronous request ? Thanku