1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Polish #615, add gateway example

This commit is contained in:
fangjian0423
2019-05-06 16:14:22 +08:00
parent 6d89d556bf
commit 1b0485402c
15 changed files with 645 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
[
{
"apiName": "some_customized_api",
"predicateItems": [
{
"pattern": "/product/baz"
},
{
"pattern": "/product/foo/**",
"matchStrategy": 1
},
{
"items": [
{
"pattern": "/spring-cloud/**"
},
{
"pattern": "/spring-cloud-alibaba/**"
}
]
}
]
},
{
"apiName": "another_customized_api",
"predicateItems": [
{
"pattern": "/ahas"
}
]
}
]

View File

@@ -0,0 +1,40 @@
server:
port: 18086
spring:
application:
name: sentinel-zuul
cloud:
sentinel:
datasource.ds2.file:
file: "classpath: gateway.json"
ruleType: gateway
datasource.ds1.file:
file: "classpath: api.json"
ruleType: api
transport:
dashboard: localhost:9999
filter:
enabled: false
management.endpoints.web.exposure.include: "*"
zuul.routes.my-service.path: "/product/foo/**"
zuul.routes.my-service.service-id: "my-service"
zuul.routes.my-service2.path: "/my-service2/**"
zuul.routes.my-service2.service-id: "my-service2"
zuul.routes.my-service3.path: "/my-service3/**"
zuul.routes.my-service3.service-id: "my-service3"
zuul.routes.my-service4.path: "/my-service4/**"
zuul.routes.my-service4.service-id: "my-service4"
spring.cloud.sentinel.zuul.order.pre: 2000
spring.cloud.sentinel.zuul.order.post: 500
spring.cloud.sentinel.zuul.order.error: -100
spring.cloud.sentinel.zuul.enabled: true

View File

@@ -0,0 +1,26 @@
[
{
"resource": "some_customized_api",
"count": 0
},
{
"resource": "my-service2",
"count": 0
},
{
"resource": "my-service3",
"count": 0,
"paramItem": {
"parseStrategy": 2,
"fieldName": "Spring-Cloud-Alibaba"
}
},
{
"resource": "my-service4",
"count": 0,
"paramItem": {
"parseStrategy": 3,
"fieldName": "name"
}
}
]