feat(ops): 增强工单队列服务并新增 RPC 配置
This commit is contained in:
@@ -32,6 +32,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@Primary
|
||||||
public class OrderQueueServiceEnhanced implements OrderQueueService {
|
public class OrderQueueServiceEnhanced implements OrderQueueService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -131,6 +131,10 @@
|
|||||||
<groupId>com.viewsh</groupId>
|
<groupId>com.viewsh</groupId>
|
||||||
<artifactId>viewsh-spring-boot-starter-mq</artifactId>
|
<artifactId>viewsh-spring-boot-starter-mq</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.rocketmq</groupId>
|
||||||
|
<artifactId>rocketmq-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Test 测试相关 -->
|
<!-- Test 测试相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.viewsh.module.ops.framework.rpc.config;
|
||||||
|
|
||||||
|
import com.viewsh.module.iot.api.device.IotDeviceControlApi;
|
||||||
|
import com.viewsh.module.system.api.notify.NotifyMessageSendApi;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration(value = "opsRpcConfiguration", proxyBeanMethods = false)
|
||||||
|
@EnableFeignClients(clients = {
|
||||||
|
NotifyMessageSendApi.class,
|
||||||
|
IotDeviceControlApi.class
|
||||||
|
})
|
||||||
|
public class RpcConfiguration {
|
||||||
|
}
|
||||||
@@ -84,6 +84,21 @@ spring:
|
|||||||
|
|
||||||
--- #################### MQ 消息队列相关配置 ####################
|
--- #################### MQ 消息队列相关配置 ####################
|
||||||
|
|
||||||
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||||
|
rocketmq:
|
||||||
|
name-server: 124.221.55.225:9876 # RocketMQ Namesrv
|
||||||
|
|
||||||
|
spring:
|
||||||
|
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
||||||
|
rabbitmq:
|
||||||
|
host: 127.0.0.1 # RabbitMQ 服务的地址
|
||||||
|
port: 5672 # RabbitMQ 服务的端口
|
||||||
|
username: guest # RabbitMQ 服务的账号
|
||||||
|
password: guest # RabbitMQ 服务的密码
|
||||||
|
# Kafka 配置项,对应 KafkaProperties 配置类
|
||||||
|
kafka:
|
||||||
|
bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔
|
||||||
|
|
||||||
--- #################### 定时任务相关配置 ####################
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
xxl:
|
xxl:
|
||||||
|
|||||||
@@ -84,7 +84,31 @@ easy-trans:
|
|||||||
|
|
||||||
--- #################### RPC 远程调用相关配置 ####################
|
--- #################### RPC 远程调用相关配置 ####################
|
||||||
|
|
||||||
--- #################### MQ 消息队列相关配置 ####################
|
--- #################### 消息队列相关 ####################
|
||||||
|
|
||||||
|
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||||
|
rocketmq:
|
||||||
|
# Producer 配置项
|
||||||
|
producer:
|
||||||
|
group: ${spring.application.name}_PRODUCER # 生产者分组
|
||||||
|
|
||||||
|
spring:
|
||||||
|
# Kafka 配置项,对应 KafkaProperties 配置类
|
||||||
|
kafka:
|
||||||
|
# Kafka Producer 配置项
|
||||||
|
producer:
|
||||||
|
acks: 1 # 0-不应答。1-leader 应答。all-所有 leader 和 follower 应答。
|
||||||
|
retries: 3 # 发送失败时,重试发送的次数
|
||||||
|
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer # 消息的 value 的序列化
|
||||||
|
# Kafka Consumer 配置项
|
||||||
|
consumer:
|
||||||
|
auto-offset-reset: earliest # 设置消费者分组最初的消费进度为 earliest 。可参考博客 https://blog.csdn.net/lishuangzhe7047/article/details/74530417 理解
|
||||||
|
value-deserializer: org.springframework.kafka.support.serializer.JsonDeserializer
|
||||||
|
properties:
|
||||||
|
spring.json.trusted.packages: '*'
|
||||||
|
# Kafka Consumer Listener 监听器配置
|
||||||
|
listener:
|
||||||
|
missing-topics-fatal: false # 消费监听接口监听的主题不存在时,默认会报错。所以通过设置为 false ,解决报错
|
||||||
|
|
||||||
--- #################### 定时任务相关配置 ####################
|
--- #################### 定时任务相关配置 ####################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user