123456789101112131415161718192021222324252627282930313233 |
- package org.example.lc.controller;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.example.lc.service.onesendmultirecver.HelloOneSender;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
- /**
- * Created with IDEA
- * User: vector
- * Data: 2017/7/7
- * Time: 17:06
- * Description:
- */
- @RestController
- @RequestMapping("/rabbit2")
- @Api(value = "单生产者-多消费者",description = "")
- public class OneSendMultiRecverController {
- @Autowired
- private HelloOneSender helloSender1;
- @ApiOperation("单生产者-多消费者")
- @RequestMapping(value = "/oneToMany",method = RequestMethod.GET)
- public void oneToMany() {
- for(int i=0;i<10;i++){
- helloSender1.send("hellomsg:"+i);
- }
- }
- }
|