[重大更新] 新增 ruoyi-common-bus 消息总线组件 基于MQ跨服务投递事件消息
parent
d28cdcd0e1
commit
9a27f42867
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-common-bus</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-common-bus 模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- rabbitmq -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
|
||||
</dependency>
|
||||
<!-- kafka -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.cloud</groupId>-->
|
||||
<!-- <artifactId>spring-cloud-starter-bus-kafka</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.common.bus.config;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.cloud.bus.jackson.RemoteApplicationEventScan;
|
||||
|
||||
/**
|
||||
* bus 配置
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@RemoteApplicationEventScan(basePackages = "${spring.cloud.bus.base-packages}")
|
||||
public class BusCustomConfiguration {
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
org.dromara.common.bus.config.BusCustomConfiguration
|
@ -0,0 +1,31 @@
|
||||
package org.dromara.demo.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
/**
|
||||
* 测试消息总线
|
||||
* <p>
|
||||
* 需要在pom引入 ruoyi-api-workflow 模块 并解除下方代码注释
|
||||
* 然后提交请假申请即可看到监听器输出日志
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/bus")
|
||||
public class TestBusController {
|
||||
|
||||
// @EventListener(condition = "#processEvent.key.startsWith('leave')")
|
||||
// public void processHandler(ProcessEvent processEvent) {
|
||||
// log.info(processEvent.toString());
|
||||
// }
|
||||
//
|
||||
// @EventListener(condition = "#processTaskEvent.key=='leave1' && #processTaskEvent.taskDefinitionKey=='Activity_14633hx'")
|
||||
// public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||
// log.info(processTaskEvent.toString());
|
||||
// }
|
||||
|
||||
}
|
Loading…
Reference in New Issue