微服务全面升级容器到 undertow,解决清理了 servlet 和 reactive 库的兼容性问题。

This commit is contained in:
Jack 2025-07-12 22:46:38 +08:00
parent 9c6825dea8
commit 060fc40424
23 changed files with 278 additions and 26 deletions

View File

@ -10,6 +10,18 @@ mall-cms
mall-search
mall-im
cd /data/sh
./mall-gateway.sh
./mall-auth.sh
./mall-account.sh
./mall-admin.sh
./mall-shop.sh
./mall-sns.sh
./mall-pay.sh
./mall-cms.sh
./mall-search.sh
./mall-im.sh
微信支付配置
{
"mchid": 商户ID,

View File

@ -18,6 +18,22 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8088
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
global-config:

View File

@ -107,7 +107,7 @@ logging:
netflix: error
org: error
io: error
reactor: error
springfox: error
reactor: error
logstash:
host: @logstash.host@

View File

@ -17,6 +17,22 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8080
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
spring:
servlet:
multipart:

View File

@ -19,6 +19,21 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.suisung.mall</groupId>
<artifactId>mall-common</artifactId>
@ -49,10 +64,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8401
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
management: #开启SpringBoot Admin的监控
endpoints:
web:

View File

@ -18,6 +18,21 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8087
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
management: #开启SpringBoot Admin的监控
endpoints:
web:

View File

@ -16,6 +16,10 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>com.suisung.mall</groupId>
<artifactId>mall-common</artifactId>
@ -46,10 +50,7 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>

View File

@ -18,6 +18,21 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8099
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
mybatis-plus:
mapper-locations: classpath:/mapper/**/*.xml
global-config:

View File

@ -18,6 +18,21 @@
<description>Demo project for Spring Boot</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-seata</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8086
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
management: #开启SpringBoot Admin的监控
endpoints:
web:

View File

@ -14,6 +14,21 @@
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.suisung.mall</groupId>
<artifactId>mall-common</artifactId>
@ -36,10 +51,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8081
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
management: #开启SpringBoot Admin的监控
endpoints:
web:

View File

@ -19,6 +19,22 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!-- mp3文件支持(如语音时长)-->
<dependency>
<groupId>org</groupId>

View File

@ -2234,7 +2234,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
// === 4. 处理退货商品信息 ===
OrderReturnInputVo partialRefund = null;
// 分退款
// 分退款
Boolean isPartialRefund = false;
int partialRefundItemCnt = 0;
if (StrUtil.isNotBlank(requestParams.getStr("order_return_vo"))) {
@ -2258,6 +2258,10 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
isPartialRefund = false;
}
String reason = StrUtil.isBlank(requestParams.getStr("reason")) ?
(isPartialRefund ? "商家部分商品退货" : "商家整单退货") :
requestParams.getStr("reason");
// === 5. 创建退货单如不存在 ===
ShopOrderReturn refundOrder = null;
if (!hasRefundRecord) {
@ -2265,10 +2269,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
// 5.2 准备退货请求数据
OrderReturnInputVo refundRequest = new OrderReturnInputVo();
refundRequest.setOrder_id(orderId);
refundRequest.setReturn_buyer_message(
StrUtil.isBlank(requestParams.getStr("reason")) ?
(isPartialRefund ? "商家部分商品退货" : "商家整单退货") :
requestParams.getStr("reason"));
refundRequest.setReturn_buyer_message(reason);
refundRequest.setUser_id(orderInfo.getBuyer_user_id());
// 5.3 处理退货商品项
@ -2298,6 +2299,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
if (createResult.getStatus() != 200) {
return createResult;
}
refundOrder = findOne(new QueryWrapper<ShopOrderReturn>().eq("order_id", orderId));
if (refundOrder == null) {
return CommonResult.failed("退货单创建失败");
@ -2309,14 +2311,13 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
refundOrder = refundOrder != null ? refundOrder :
findOne(new QueryWrapper<ShopOrderReturn>().eq("order_id", orderId));
refundOrder.setReturn_flag(0);
String reason = StrUtil.isBlank(requestParams.getStr("reason")) ?
(isPartialRefund ? "商家部分商品退货" : "商家整单退货") :
requestParams.getStr("reason");
refundOrder.setReturn_store_message(reason);
refundOrder.setReturn_buyer_message(reason);
logger.info("商家退款订单:{}", refundOrder);
if (!processReviewList(refundOrder, 0)) {
return CommonResult.failed("退货处理失败");
return CommonResult.failed("退处理失败");
}
// === 7. 特殊场景同城配送订单取消 ===
@ -2332,8 +2333,8 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
return CommonResult.success();
} catch (Exception e) {
log.error("商家处理退异常", e);
return CommonResult.failed("系统处理退时发生异常");
log.error("商家处理退异常", e);
return CommonResult.failed("系统处理退时发生异常");
}
}

View File

@ -1,5 +1,17 @@
server:
port: 8089
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
spring:
messages:
basename: i18n/messages #配置国际化资源文件路径

View File

@ -18,6 +18,22 @@
<description>Demo project for Spring Boot</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>

View File

@ -1,5 +1,17 @@
server:
port: 8085
server:
undertow:
io-threads: 2
worker-threads: 200
buffer-size: 16384
direct-buffers: true
max-connections: 2000
queue-size: 100
no-request-timeout: 60000
connection-timeout: 60000
max-http-header-size: 8192
max-http-post-size: 200MB
management: #开启SpringBoot Admin的监控
endpoints:
web:

View File

@ -538,7 +538,6 @@
<!--定义容器启动命令,注意不能换行-->
<entryPoint>["java", "-jar", "-Xms128m", "-Xmx512m", "-XX:PermSize=64M", "-XX:MaxPermSize=512M", "-Dspring.profiles.active=${spring.profile}", "-Duser.timezone=Asia/Shanghai", "/${project.build.finalName}.jar"]
</entryPoint>
<!-- <entryPoint>["java","-jar","-Xms128m","-Xmx512m","-XX:MetaspaceSize=128m","-XX:MaxMetaspaceSize=256m","-XX:+UseG1GC","-XX:+HeapDumpOnOutOfMemoryError","-XX:HeapDumpPath=/var/log/heapdump.hprof","-Xloggc:/var/log/gc.log","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=${spring.profile}","-Duser.timezone=Asia/Shanghai","/mall-gateway.jar"]</entryPoint>-->
<!--推送镜像仓库校验安全证书,无安全证书无法推送-->
<dockerCertPath>${docker.ca}</dockerCertPath>
<resources>