HornetQ Core API and JMS

狂风中的少年 提交于 2019-12-06 08:57:17

问题


I have few questions regarding HornetQ:

  1. What are differences between HornetQ core API and the JMS API ?

  2. is there any advantage or disadvantage on using one of these ?

  3. Is it true to say if I use the core API and then I decide to change my Messaging Bus (let's say to ActiveMQ) then I have to change all my codes ?


回答1:


  1. HornetQ Core API is a proprietary API from HornetQ, while the JMS API is a standard API defined by the Java Community Process.

  2. There are a few features that are not supported on JMS API, that are available through core-api:

    • It's not possible to have multiple consumers on a single topic subscription (say if you wanted to have multiple consumers to scale it better)

    • It's more generic on how you create the subscription. You just create a queue within an address. Very simple.

    • We have a nice API for asynchronous confirmations. No need to block ever if you use this feature.

The advantage on the JMS is portability. Your code stays the same if you decide to move between providers.

The disadvantage on JMS is that it lacks some features and it's a bit verbose, what's under works on JMS 2 JSR right now.

  1. Yes, because as I have said here, Hornetq-core api is a proprietary API, hence it will only work on HornetQ. The same way as some message systems will have a proprietary API.

If you encapsulate your Messaging access you can minimize that a lot though where you could just replace a single class on your system using standard OO techniques.



来源:https://stackoverflow.com/questions/8041249/hornetq-core-api-and-jms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!