您会使用发布/订阅或队列来进行长时间运行的后台进程吗?
我有一个 Web 服务,它接收在 Oracle 数据库中执行一些数据传输操作的请求(此类传输操作大约需要 30 分钟到 2 小时)。我设计的 Web 服务是为了将 JMS 用于这些流程。一旦请求到达,消息就会发送到 ActiveMQ,有一个侦听器类接收这些消息,然后调用处理程序类来执行操作。现在我的问题是:我对 JMS 很陌生,并且我知道有一些方法可以处理消息传递:pub/sub 和队列,所以在这种情况下,pub/sub 是首选方法还是队列?各自的优点/缺点是什么?
谢谢!
I have a webservice which receives requests to perform some data transfer operations within an Oracle database (such transfer operation takes about 30mins to 2 hours). I designed the webservice to use JMS for these processes. Once a request arrives, a message is sent to ActiveMQ, there's a listener class that receives those and then calls a handler class to perform the operations. Now my question is: I'm quite new to JMS, and I know there are methods to approach messaging: pub/sub and queues, so in this case, is pub/sub the preferred approach or queues? What are the pros/cons of each?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这相当简单:
It's rather straightforward: