feat: There is no way the MQ conf

This commit is contained in:
super_liu
2021-09-19 15:58:26 +08:00
parent 7fcda70b9b
commit 96d9b84018
4 changed files with 20 additions and 13 deletions
+5
View File
@@ -39,6 +39,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId> <artifactId>spring-boot-starter-amqp</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Feign客户端 --> <!-- Feign客户端 -->
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
@@ -44,7 +44,7 @@ public class SendDoneMQService {
value = @Queue(value = "createMQDone_SQ_GSAR", durable = "true"), value = @Queue(value = "createMQDone_SQ_GSAR", durable = "true"),
exchange = @Exchange(value = "sendDone-exchange_MQ_GSAR", ignoreDeclarationExceptions = "true"), exchange = @Exchange(value = "sendDone-exchange_MQ_GSAR", ignoreDeclarationExceptions = "true"),
key = "sendDone-key_MQ_GSAR")) key = "sendDone-key_MQ_GSAR"))
public void createMQ(NotifyTodoSendContext object, Message message, Channel channel) throws Exception{ public void createMQDone(NotifyTodoSendContext object, Message message, Channel channel) throws Exception{
try{ try{
try{ try{
insertOrUpdateInfo(object); insertOrUpdateInfo(object);
@@ -84,24 +84,22 @@ public class SendDoneMQService {
} }
public void restartSendMq(NotifyTodoSendContext object) throws Exception{ public void restartSendMq(NotifyTodoSendContext object) throws Exception{
SendTodoLog sendTodoLog = new SendTodoLog();
QueryWrapper wrapper = new QueryWrapper(); QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("TODO_ID",object.getModelId()); wrapper.eq("TODO_ID",object.getModelId());
wrapper.eq("MSG_TYPE","1"); wrapper.eq("MSG_TYPE","1");
List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper); List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper);
if(!list.isEmpty()){
sendTodoLog = list.get(0);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
if(sendTodoLog != null){ if(!list.isEmpty()){
SendTodoLog sendTodoLog = list.get(0);
int againNumNew = Integer.valueOf(sendTodoLog.getErrNum()); int againNumNew = Integer.valueOf(sendTodoLog.getErrNum());
if(againNumNew >= 6){ if(againNumNew >= 6){
// 发送待办 或 发送给管理员邮箱 // 发送待办 或 发送给管理员邮箱
logger.info("发送失败9次,发送给管理员邮箱"); logger.info("发送失败6次,发送给管理员邮箱");
}else { }else {
restSendDoneTodo(object, sdf, sendTodoLog, againNumNew); restSendDoneTodo(object, sdf, sendTodoLog, againNumNew);
} }
}else { }else {
sendTodoSave(object, sdf, "3"); sendTodoSave(object, sdf, "3");
} }
@@ -3,13 +3,15 @@ package com.ydw.bat.wkflow.business_oa.webService.todoContent;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
/** /**
* @Description: TODO * @Description: TODO
* @author: super_liu * @author: super_liu
* @date: 2021年09月08日 15:05 * @date: 2021年09月08日 15:05
*/ */
@Data @Data
public class NotifyTodoSendContext { public class NotifyTodoSendContext implements Serializable {
@ApiModelProperty(value = "标识待办来源的系统") @ApiModelProperty(value = "标识待办来源的系统")
private String appName; private String appName;
+7 -5
View File
@@ -15,7 +15,7 @@ logging:
eureka: eureka:
client: client:
serviceUrl: serviceUrl:
defaultZone: http://127.0.0.1:8761/eureka/ defaultZone: http://62.234.136.153:8761/eureka/
spring: spring:
application: application:
name: bat-wkflow name: bat-wkflow
@@ -31,7 +31,7 @@ spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/foton-bat-wkflow?nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false&characterEncoding=utf-8 url: jdbc:mysql://39.100.23.127:3306/foton-bat-wkflow?nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false&characterEncoding=utf-8
username: root username: root
password: root password: root
activiti: activiti:
@@ -42,12 +42,14 @@ spring:
active: dev active: dev
# 相关服务配置同业务系统 # 相关服务配置同业务系统
rabbitmq: rabbitmq:
host: 127.0.0.1 host: 62.234.136.153
port: 5672 port: 5672
username: guest username: guest
password: guest password: guest
listener: listener:
simple: simple:
concurrency: 5
max-concurrency: 10
acknowledge-mode: manual acknowledge-mode: manual
#消费失败消息干掉 #消费失败消息干掉
default-requeue-rejected: true default-requeue-rejected: true
@@ -56,7 +58,7 @@ spring:
initial-interval: 5000 initial-interval: 5000
enabled: true enabled: true
#最大重试9次 #最大重试9次
max-attempts: 9 max-attempts: 6
mybatis-plus: mybatis-plus:
configuration: configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
@@ -66,5 +68,5 @@ ribbon:
ConnectTimeout: 60000 ConnectTimeout: 60000
# 配置前端服务全路径地址 如下 /#/ # 配置前端服务全路径地址 如下 /#/
webUrl: http://127.0.0.1:10088/#/ webUrl: http://62.234.136.153:8038/#/