mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-04 17:45:34 +08:00
JeecgBoot3.2.0 版本发布 [优化微服务模块]
This commit is contained in:
@ -2,6 +2,8 @@ package org.jeecg.modules.test.rabbitmq.constant;
|
||||
|
||||
/**
|
||||
* 微服务单元测试常量定义
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
public interface CloudConstant {
|
||||
|
||||
|
||||
@ -19,6 +19,8 @@ import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* RabbitMqClient发送消息
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sys/test")
|
||||
|
||||
@ -11,6 +11,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 消息处理器【发布订阅】
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
@Slf4j
|
||||
@Component(CloudConstant.MQ_DEMO_BUS_EVENT)
|
||||
|
||||
@ -21,6 +21,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
*
|
||||
* RabbitMq接受者1
|
||||
* (@RabbitListener声明类上,一个类只能监听一个队列)
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
@Slf4j
|
||||
@RabbitListener(queues = CloudConstant.MQ_JEECG_PLACE_ORDER)
|
||||
|
||||
@ -17,6 +17,8 @@ import org.springframework.messaging.handler.annotation.Header;
|
||||
*
|
||||
* RabbitMq接受者2
|
||||
* (@RabbitListener声明类上,一个类只能监听一个队列)
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
@Slf4j
|
||||
@RabbitListener(queues = CloudConstant.MQ_JEECG_PLACE_ORDER)
|
||||
|
||||
@ -16,6 +16,8 @@ import org.springframework.messaging.handler.annotation.Header;
|
||||
*
|
||||
* RabbitMq接受者3【我是处理人3】
|
||||
* (@RabbitListener声明类方法上,一个类可以多监听多个队列)
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
@Slf4j
|
||||
@RabbitComponent(value = "helloReceiver3")
|
||||
|
||||
@ -14,6 +14,11 @@ import com.rabbitmq.client.Channel;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 定义接收者(可以定义N个接受者,消息会均匀的发送到N个接收者中)
|
||||
* @author: zyf
|
||||
* @date: 2022/04/21
|
||||
*/
|
||||
@Slf4j
|
||||
@RabbitListener(queues = CloudConstant.MQ_JEECG_PLACE_ORDER_TIME)
|
||||
@RabbitComponent(value = "helloTimeReceiver")
|
||||
|
||||
Reference in New Issue
Block a user