我已经使用mulesoft中的cxf公开了soap web服务,这是我的界面和java代码。
界面是:
@WebService
public interface HelloWorld {
String sayHi(String text);
}
java类是:
@WebService(endpointInterface = "demo.HelloWorld",
serviceName = "HelloWorld")
public class HelloWorldImpl implements HelloWorld {
public String sayHi(String text) {
/*
Here i am writing the logic which is takes the 15 seconds
and i do not want that caller webservices must be wait to finish
this process.
*/
return "Hello " + text;
}
}
当前调用者正在等待完成所有逻辑 sayHI()方法,但我想以异步方式做,这意味着sayHi()方法连续进程,调用者不等待响应。那么任何想法如何在mulesoft中实现?。
这是mule soft中的参考: https://docs.mulesoft.com/mule-user-guide/v/3.7/building-web-services-with-cxf
答案 0 :(得分:0)
您是否考虑过使用流量处理策略和调整线程? :
https://docs.mulesoft.com/mule-user-guide/v/3.7/flow-processing-strategies https://docs.mulesoft.com/mule-fundamentals/v/3.7/flows-and-subflows http://blogs.mulesoft.com/dev/mule-dev/asynchronous-message-processing-with-mule/
并且在流程中你也可以在你的Http监听器之后使用block来使它异步: -
https://docs.mulesoft.com/mule-user-guide/v/3.7/async-scope-reference