I have this class DemoController
. In this class I want to send a message along with REST request.
How can I send it? Suppose M sending http://localhost:8080/sendmessage...
How can I send a message along with this request?
@RestController
@EnableAutoConfiguration
public class DemoController {
@Autowired
DemoPublisher demopublisher;
@Autowired
DemoConsumer democonsumer;
@RequestMapping(value="/sendmessage", method= {RequestMethod.POST})
@ResponseBody
public String messageSenderController(@RequestParam String message, Model model){
try {
demopublisher.demoPublishMessage(message);
} catch (JMSException e) {
e.printStackTrace();
}
return message;
}
}