difference between embedded and standalone activemq broker

我是研究僧i 提交于 2019-12-23 02:19:18

问题


I am using Spring for my application. I am wondering what differences there is between "embedded" ActiveMQ and "stand-alone" ActiveMQ. If I run ActiveMQ embedded, does thing mean remote clients can still connect up? Is my understand correct that embeded ActiveMQ means that ActiveMQ will start automatically when I start my Spring application, or is there some other meanings to it?

For example Let's say I have deployed one application in system-A and deployed the same application in system-B.in the application I have configured embedded ActiveMQ broker through spring xml files with broker url as tcp:10.1.1.10;

If I send messages to activemq broker in system-A ,can I consume the same messages in system-B?


回答1:


Embedded ActiveMQ vs Standalone ActiveMQ difference is exactly the difference between the words 'Embedded' and 'Standalone'.

Let me explain in context of a Camel Application:

StandAlone ActiveMQ means, that you have ActiveMQ and you move your Camel Application jar file into its Lib folder. You import the Camel Application's camel-context.xml file in your Activemq's activemq.xml file. You start activeMQ.sh which starts ActiveMQ and creates your Camel Routes with it.

Note here, we are moving artifacts to ActiveMQ distribution which is not inside any other container. This ActiveMQ distribution can be on your local machine itself.

On the Other Hand:

An Embedded ActiveMQ means that you provide ActiveMQ ability to some other container. For example, You enable ActiveMQ capabilities in any Application Server. In this case you do not start ActiveMQ per se. You simply start the enclosing container and ActiveMQ capabilities are made available as the container startsup.

For example, you can have Tomcat on your local machine. You move few relevant activeMq jars in Tomcat's lib folder. You may have to configure Tomcat's config file in some scenarios. For instance in case you are providing queues as JNDI object, then the queue needs to be configured as a Resource.

Hope this helps.

Reference: http://icodingclub.blogspot.com/2011/09/spring-jms-with-embeded-activemq-in.html




回答2:


Yes you are right about embedded ActiveMQ , It resides and runs inside a application you deploy, this instance of activeMQ starts and stops when application itself starts or stops.

Standalone ActiveMQ instance runs on its own and can be independently started and stopped

For your question, yes you can consume the messages from different systems with embedded activeMQ instances.

Hope this helps! Good luck!



来源:https://stackoverflow.com/questions/28850192/difference-between-embedded-and-standalone-activemq-broker

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