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>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
<!-- Feign客户端 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
@@ -44,7 +44,7 @@ public class SendDoneMQService {
value = @Queue(value = "createMQDone_SQ_GSAR", durable = "true"),
exchange = @Exchange(value = "sendDone-exchange_MQ_GSAR", ignoreDeclarationExceptions = "true"),
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{
insertOrUpdateInfo(object);
@@ -84,24 +84,22 @@ public class SendDoneMQService {
}
public void restartSendMq(NotifyTodoSendContext object) throws Exception{
SendTodoLog sendTodoLog = new SendTodoLog();
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("TODO_ID",object.getModelId());
wrapper.eq("MSG_TYPE","1");
List<SendTodoLog> list = sendTodoLogMapper.selectList(wrapper);
if(!list.isEmpty()){
sendTodoLog = list.get(0);
}
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());
if(againNumNew >= 6){
// 发送待办 或 发送给管理员邮箱
logger.info("发送失败9次,发送给管理员邮箱");
logger.info("发送失败6次,发送给管理员邮箱");
}else {
restSendDoneTodo(object, sdf, sendTodoLog, againNumNew);
}
}else {
sendTodoSave(object, sdf, "3");
}
@@ -3,13 +3,15 @@ package com.ydw.bat.wkflow.business_oa.webService.todoContent;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @Description: TODO
* @author: super_liu
* @date: 2021年09月08日 15:05
*/
@Data
public class NotifyTodoSendContext {
public class NotifyTodoSendContext implements Serializable {
@ApiModelProperty(value = "标识待办来源的系统")
private String appName;
+7 -5
View File
@@ -15,7 +15,7 @@ logging:
eureka:
client:
serviceUrl:
defaultZone: http://127.0.0.1:8761/eureka/
defaultZone: http://62.234.136.153:8761/eureka/
spring:
application:
name: bat-wkflow
@@ -31,7 +31,7 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
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
password: root
activiti:
@@ -42,12 +42,14 @@ spring:
active: dev
# 相关服务配置同业务系统
rabbitmq:
host: 127.0.0.1
host: 62.234.136.153
port: 5672
username: guest
password: guest
listener:
simple:
concurrency: 5
max-concurrency: 10
acknowledge-mode: manual
#消费失败消息干掉
default-requeue-rejected: true
@@ -56,7 +58,7 @@ spring:
initial-interval: 5000
enabled: true
#最大重试9次
max-attempts: 9
max-attempts: 6
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
@@ -66,5 +68,5 @@ ribbon:
ConnectTimeout: 60000
# 配置前端服务全路径地址 如下 /#/
webUrl: http://127.0.0.1:10088/#/
webUrl: http://62.234.136.153:8038/#/