Aias00 opened a new issue, #7561:
URL: https://github.com/apache/shenyu/issues/7561

   ### Feature Request
   
   Provide a reusable, documented host bridge for real request/configuration 
data and guest results in AbstractShenyuWasmPlugin.
   
   ### Is your feature request related to a problem? Please describe
   
   The [default 
constructor](https://github.com/apache/shenyu/blob/2dff2730ff399635b2bc657e21a903f391fb9df8/shenyu-plugin/shenyu-plugin-wasm-base/src/main/java/org/apache/shenyu/plugin/wasm/base/AbstractShenyuWasmPlugin.java#L62)
 creates a plain `new WasmLoader(this.getClass(), null)`. Its built-in host 
functions delegate to 
[onGetArgs/onPutResult](https://github.com/apache/shenyu/blob/2dff2730ff399635b2bc657e21a903f391fb9df8/shenyu-plugin/shenyu-plugin-wasm-api/src/main/java/org/apache/shenyu/plugin/wasm/api/loader/WasmLoader.java#L245),
 both of which return 0 by default.
   
   The guest can execute, but the default bridge supplies no serialized 
request/selector/rule data and ignores results. Subclasses can use the 
Consumer<Store> constructor to implement this manually; existing tests do so 
with fixed strings.
   
   Configuration handlers and request plugins also own separate loaders/guest 
instances. Updating configuration in a handler's guest memory does not 
automatically update request-execution state. Java-side shared caches/host 
callbacks can bridge this today, but the base library offers no documented 
end-to-end pattern.
   
   ### Describe the solution you'd like
   
   - Provide a supported bridge for request metadata, selector/rule 
configuration and guest results, while retaining custom HostFunction support.
   - Define how guest results map to chain continuation, rejection or supported 
HTTP changes.
   - Document and demonstrate how configuration updates become visible to 
request execution across independently instantiated handlers/plugins.
   - Define buffer sizing, serialization, error and cleanup behavior.
   - Test the default/supported bridge with real DTOs and HTTP exchanges, not 
only fixed strings.
   
   ### Describe alternatives you've considered
   
   Require every plugin to register all host functions manually. If this 
remains the intended design, make the default no-op behavior explicit and 
supply a complete reusable example.
   
   ### Additional context
   
   ShenYu: `2.7.2-SNAPSHOT`, commit `2dff2730ff399635b2bc657e21a903f391fb9df8`; 
Java 17; Chicory 1.7.3.
   
   This is an enhancement request, not a claim that custom Java adapters cannot 
work.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to