Divyansh200102 commented on issue #5427:
URL: https://github.com/apache/shenyu/issues/5427#issuecomment-1946169398

   Sorry for the trouble @loongs-zhang 
   In the documentation WASM section of `Matching Traffic Processing Plugin in 
Multiple Languages` the `doExecute` method is not implemented in rust which is 
needed for building the plugin for `shenyu-plugin-wasm-base`  
   
![image](https://github.com/apache/shenyu/assets/146909065/27675a7c-1e1b-4e60-800f-ebbdf66dac66)
   but in case of `Single Responsibility Plugin in Multiple Languages` which 
had the `execute` method it was provided in the documentaion.
   
   ```rust
   #[no_mangle]
   pub unsafe extern "C" fn execute(arg_id: i64) {
       let mut buf = [0u8; 32];
       let buf_ptr = buf.as_mut_ptr() as i64;
       eprintln!("rust side-> buffer base address: {}", buf_ptr);
       // get arg from java
       let len = get_args(arg_id, buf_ptr, buf.len() as i32);
       let java_arg = std::str::from_utf8(&buf[..len as usize]).unwrap();
       eprintln!("rust side-> recv:{}", java_arg);
       // pass rust result to java
       let rust_result = "rust result".as_bytes();
       let result_ptr = rust_result.as_ptr() as i64;
       _ = put_result(arg_id, result_ptr, rust_result.len() as i32);
   }
   ``` 
   So could you please tell how am I supposed to proceed from here?
   
   
   


-- 
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