使用 cxf 和 java 第一种方法编写异步服务
我需要使用 cxf 和 java 第一种方法创建一个异步 Web 服务。但我无法
找到任何网络资源/网站来告诉我如何做到这一点?
您能告诉我如何使用 CXF 和 java 第一种方法编写异步 Web 服务吗?
谢谢谢卡尔
I need to create a async webservice using cxf with java first approach. But i am unable to
find any web resource/ website which tells me how to do this?
Can you please tell how can I write a async webservice using CXF with java first approach?
Thanks
Shekhar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个可以在多种情况下使用的简单替代方案:
优点:
缺点:
A simple alternative that can work in many situations:
Advantages:
Disadvantages:
在 Web 服务后面使用 ActiveMQ 等消息传递基础设施 - 正常获取 Web 服务请求,获取请求消息并将其发布到 ActiveMQ 中的入站队列,并同步响应确认。使用一些批处理基础设施(批处理作业、队列上的侦听器等)处理入站队列,然后在处理完成后,将完成信息发布回调用者 - 使用消息传递基础设施或与数据库结合使用。
Use a messaging infrastructure like ActiveMQ behind your webservice - get the webservice request normally, take the request message and post it to an inbound queue in ActiveMQ and respond with an acknowledgement synchronously. Process the inbound queue using some batch infrastructure (batch jobs, listeners on Queue etc) and then once processing is complete, either post a completion back to the caller - either using the messaging infrastructure or in conjunction with DB.