package com.docus.server.collect.user.mq.test;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 生产者
 * @Author jxb
 * @Date 2019-03-09 09:43:47
 */
@RestController
@RequestMapping("mqProducer")
public class RabbitMQProducer {

//    @Autowired
//    public RabbitTemplate rabbitTemplate;
//    @Inject
//    private TaskConfigServiceImpl userService;
//
//    /**
//     * @Description topic n:1 类型 交换器队列 生产(3个)
//     * @Author jxb
//     * @Date 2019-03-09 09:56:45
//     */
//    @RequestMapping(value = "/topicMQ01", method = {RequestMethod.GET})
//    public List<TaskConfig> topicMQ01() {
//        List<TaskConfig> users = userService.page(null);
//        for (TaskConfig user : users) {
//            rabbitTemplate.convertAndSend("topic.exchange", "jd.reg.msg", user.getName());
//        }
//        return users;
//    }
//
//    @RequestMapping(value = "/topicMQ02", method = {RequestMethod.GET})
//    public List<TaskConfig> topicMQ02() {
//        List<TaskConfig> users = userService.page(null);
//        for (TaskConfig user : users) {
//            rabbitTemplate.convertAndSend("topic.exchange", "tm.reg.msg", user.getName());
//        }
//        return users;
//    }
//
//    @RequestMapping(value = "/topicMQ03", method = {RequestMethod.GET})
//    public List<TaskConfig> topicMQ03() {
//        List<TaskConfig> users = userService.page(null);
//        for (TaskConfig user : users) {
//            rabbitTemplate.convertAndSend("topic.exchange", "super.fzb.reg.msg", user.getName());
//        }
//        return users;
//    }

}
