@@ -5,4 +5,9 @@
- Redis
- jdbc,mybatis
- MongoDB
-- Spring Data Stream 集成rabbit
+- Spring Data Stream 集成rabbit
+
+## tuon-gateway
+基于Spring Cloud 的网关;
+如果加载了依赖,但是不想启用网关功能可用:spring.cloud.gateway.enable=false 禁用网关功能
@@ -2,4 +2,5 @@ rootProject.name = 'tuon-framework'
include 'tuon-core'
include 'tuon-web'
include 'tuon-qywx'
+include 'tuon-gateway'
@@ -0,0 +1,8 @@
+group 'cn.tonyandmoney.tuon'
+version '0.0.1'
+dependencies{
+ api('org.springframework.cloud:spring-cloud-starter-gateway')
+}
@@ -0,0 +1,19 @@
+spring:
+ cloud:
+ gateway:
+ discovery:
+ locator:
+ enabled: true
+ lower-case-service-id: true
+ default-filters:
+ - name: Retry # 进行三次重试,只对GET查询进行重试
+ args:
+ retries: 3
+ series: SERVER_ERROR
+ statuses:
+ - BAD_GATEWAY
+ methods:
+ - GET
+ exceptions:
+ - java.io.IOException
+ - java.util.concurrent.TimeoutException
@@ -20,6 +20,7 @@ version '0.1.0'
dependencies {
compile project(':tuon-core')
compile project(':tuon-qywx')
+ compile project(':tuon-gateway')
implementation('org.springframework.boot:spring-boot-starter-webflux')
}
@@ -9,6 +9,7 @@ spring:
name: tuon
profiles:
active: sit
+ include: gateway
cloud:
config:
profile: ${spring.profiles.active}