public class OssProxyPlugin
extends org.apache.shenyu.plugin.base.AbstractShenyuPlugin
Replaces api-gateway's PagesController.statics() — proxies static resources (HTML/JS/CSS/images) from Alibaba Cloud OSS via non-blocking WebClient streaming.
When a request matches a configured selector (e.g. /rest/operation_applet/**), this plugin fetches the corresponding file from OSS and streams it back as the response. The plugin chain is NOT continued (the response is written directly).
Execution order: 196 (after logging plugins, before DIVIDE at 200). Must run before divide because divide's handleSelectorIfNull returns error instead of continuing the chain. Uses static-resource detection to avoid intercepting API requests — only paths with file extensions (.html, .js, .css, etc.) are proxied to OSS; all other paths continue the plugin chain.
| 构造器和说明 |
|---|
OssProxyPlugin(org.springframework.web.reactive.function.client.WebClient webClient)
Instantiates a new OssProxy plugin.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected reactor.core.publisher.Mono<java.lang.Void> |
doExecute(org.springframework.web.server.ServerWebExchange exchange,
org.apache.shenyu.plugin.api.ShenyuPluginChain chain,
org.apache.shenyu.common.dto.SelectorData selector,
org.apache.shenyu.common.dto.RuleData rule) |
int |
getOrder() |
java.lang.String |
named() |
execute, handleRuleIfNull, handleSelectorIfNullpublic OssProxyPlugin(org.springframework.web.reactive.function.client.WebClient webClient)
webClient - the web client for non-blocking HTTP calls to OSSprotected reactor.core.publisher.Mono<java.lang.Void> doExecute(org.springframework.web.server.ServerWebExchange exchange,
org.apache.shenyu.plugin.api.ShenyuPluginChain chain,
org.apache.shenyu.common.dto.SelectorData selector,
org.apache.shenyu.common.dto.RuleData rule)
doExecute 在类中 org.apache.shenyu.plugin.base.AbstractShenyuPluginpublic int getOrder()
public java.lang.String named()
Copyright © 2026 The Apache Software Foundation. All rights reserved.