用于 JCA 入站消息传递的 JMS?
我正在实现 JCA 入站模型,因此我正在研究从 Google 找到的可用参考实现。
到目前为止,我设法找到了 2 个示例实现,在这两个实现中,对于入站消息,它们只是定义一个简单的 MessageListener 接口并直接调用 onMessage 方法。
所以我想知道使用 JMS 而不是用户定义的 MessageListener 是否有任何优点/缺点。
提前致谢。
问候,
基海因
I am implementing JCA Inbound model so I am studying available reference implementations that I found from Google.
So far I managed to find 2 sample implementations and in both implementation, for inbound messages, they just define a simple MessageListener interface and directly call onMessage method on it.
So I'd like to know if there is any pros/cons to use JMS instead of user defined MessageListener.
Thanks in advance.
Regards,
Kyi Hein
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您将编写自己的 JCA 实现,因此我不建议您“重用”JMS 的 MessageListener 接口。即使您自己设计的接口与 MessageListener 非常相似,最好保留您自己的接口。
谢谢,
镍丁
As you would be writing your own JCA implementation, I won't recommend you "reuse" the JMS's MessageListener interface. Even if the interface which you would design by yourself is quite similar to the MessageListener, it would be better to keep your own interface.
Thanks,
Nitin
如果您计划向更广泛的社区开放您的解决方案,那么设计需要标准 MessageListener 接口的 JCA 适配器是个好主意。人们用来学习 JCA 的几乎每个 JCA 示例都与 MessageListener 相关,更重要的是(对我来说)它被打包在 j2ee 库中。就我个人而言,当我被迫添加库时,我感到恶心和恐惧,只是因为有人认为特殊的监听器接口很酷,尽管它为开发人员提供了与标准 MessageListener 相同的方法。
If you plan to open your solution to wider community is good idea to design JCA adapters that requires standard MessageListener interface. Almost every JCA example that people use to learn JCA, relates to MessageListener and what is more important (for me) it is packaged in j2ee libraries. Personaly, I'm sick and horrified when I'm forced to add libraries just because somebody ment that special Listener interface is cool despite the fact it provides developer with same methods as standard MessageListener.