How to enable ActiveMQ in Servicemix

Out of the box, every ServiceMix instance comes with an embedded ActiveMQ JMS (Java Message Service) broker. This feature makes it easy to communicate between Camel routes using persistent messages and also to distribute messages over multiple instances using clustering or load balancing.

The ActiveMQ Web Console feature is included  in any ActiveMQ distribution and you'll probably want to have it installed in ServiceMix as well to make sure you can monitor your JMS broker.

So, the first thing you have to do is to install the war feature running the following command:

karaf@root> features:install war



Then you can do run the following command to install the ActiveMQ Web Console:


karaf@root> features:install activemq-web-console


This command will install and start the web console automatically with an embedded broker which you  can access going to the following URL: http://localhost:8181/activemqweb


But that brings the first issue... Once you have the default embedded ActiveMQ broker running then the Web Console will fail to start since it also tries to start an instance of the ActiveMQ basically on the same port number. It's quite frustrating to install a feature on ServiceMix and not be able to test it or execute it right away.

So, to configure the ActiveMQ Web Console to connect to the default embedded broker you have to do a little extra configuration change but that should be straightforward.

Go to $SMX_HOME/etc and edit the system.properties file then add the following details:


webconsole.type=properties
webconsole.jms.url=tcp://localhost:61616
webconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
webconsole.jmx.user=smx
webconsole.jmx.password=smx




Save it and (re)start ServiceMix. That should be enough to get the ActiveMQ Web Console connected to the default embedded broker in ServiceMix.

If you don't want to monitor the default embedded broker but want to stick with the instance that the Web Console starts for you then all you will have to do is to uninstall the default embedded ActiveMQ broker with the following command:


karaf@root> features:uninstall activemq-broker


and then restart ServiceMix. This way there will be no conflicts on the ActiveMQ port number anymore.

The downloaded bundles in servicemix are stored in apache-servicemix-5.1.0\data\cache.

你可能感兴趣的:(activemq)