58 lines
1.6 KiB
YAML
Raw Normal View History

2019-07-22 18:30:56 +08:00
default-filters:
- AddResponseHeader=X-Response-Default-Foo, Test-Default-Bar
restful: # filters 必须 有predicates uri只是预期到达的地址
routes:
- id: haha
uri: http://localhost:4444
order: 0
predicates:
- Path=/http/hello
- id: rewrite
uri: http://localhost:4444
order: 0
predicates:
- Path=/http/rewrite
filters:
- RewritePath=/http/rewrite, /http/hello
- id: xixi
uri: http://localhost:8888
order: 11
predicates:
- Path=/http/xixi
filters:
- RedirectTo=302, http://localhost:4444/http/hello
dubbo:
routes:
- id: test
application: dubbo-exchange
# methods: # 如果没填就从 request拿 意味着所有接口都可以使用
# - name: Say
# param-types:
# - java.lang.String
# - name: Hello
connections: 4
group: test
registry: zookeeper://127.0.0.1:2181
interface: ocean.demo.api.IExchange
version: 1.0.0
predicates:
- Path=/dubbo/hello
filters:
- name: RequestRateLimiter
args:
key-resolver: '#{@ipResolver}' #SPEL表达式去的对应的bean
redis-rate-limiter.replenishRate: 81 # 令牌桶的容积
redis-rate-limiter.burstCapacity: 40 # 流速 每秒
# - name: RequestRateLimiter1
# args:
# redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
# redis-rate-limiter.burstCapacity: 3 # 流速 每秒
# key-resolver: "#{@ipResolver}" #SPEL表达式去的对应的bean