Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between embedded and standalone activemq broker

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?

like image 847
user739115 Avatar asked Feb 11 '23 18:02

user739115


2 Answers

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

like image 194
DolphinJava Avatar answered Feb 13 '23 07:02

DolphinJava


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!

like image 34
Vihar Avatar answered Feb 13 '23 06:02

Vihar