TestSendController.java 632 B

12345678910111213141516171819202122232425
  1. package com.fdkankan.modeling.test;
  2. import org.springframework.web.bind.annotation.RequestMapping;
  3. import org.springframework.web.bind.annotation.RestController;
  4. import javax.annotation.Resource;
  5. @RestController
  6. @RequestMapping("/send")
  7. public class TestSendController {
  8. @Resource
  9. com.fdkankan.mq.util.RocketMQProducer rocketMQProducer;
  10. private final String topic ="test_model_order";
  11. @RequestMapping("/test")
  12. private void sentTest(){
  13. rocketMQProducer.sendInOrder(topic,"1");
  14. }
  15. @RequestMapping("/test1")
  16. private void sentTest1(){
  17. rocketMQProducer.sendOneWay(topic,"1");
  18. }
  19. }