Spring异步RMI调用 [英] Spring Async RMI Call
问题描述
是否可以异步调用Java RMI?我希望我的RMI调用立即返回,并且服务器在任务完成后调用回调。
Is it possible to invoke Java RMI asynchronously? I'd like my RMI call to return immediately and for the server to invoke a callback once a task is completed.
我目前使用Spring框架的RMI支持,我在春天找不到任何文档描述它,我怀疑我需要自己实现它。请尽可能提供实例。
I'd currently using RMI support from Spring framework, and i couldn't find any documentation describing it in spring, I suspect I'll need to implement it myself. Please provide examples if possible.
提前感谢!
推荐答案
RMI是同步的,根据我所知不支持回调。
RMI is synchronous and doesn't support callbacks as far as I know.
JMS是进行异步调用的Java EE方式。如果你使用Spring,它将是一个消息驱动的POJO。
JMS is the Java EE way to make asynch calls. If you're using Spring, it would be a message-driven POJO.
另一个地方,因为你已经使用Spring,是Spring 批次或Spring 整合。我会尝试这些之前,我自己写的。
Another place to look, since you're already using Spring, is either Spring Batch or Spring Integration. I'd try either of those before I wrote it myself.
但如果这不适合你,你的怀疑是正确的 - 你必须自己实现。
But if that doesn't do it for you, your suspicion is correct - you'll have to implement it yourself.
这篇关于Spring异步RMI调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!