difference between embedded and standalone activem

2019-06-05 01:19发布

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?

2条回答
闹够了就滚
2楼-- · 2019-06-05 01:20

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

查看更多
祖国的老花朵
3楼-- · 2019-06-05 01:34

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!

查看更多
登录 后发表回答