ActiveMQ 5.4: Seamless OSGi Integration

For upcoming ActiveMQ 5.4.0 release we did a lot of work to make it a better citizen in OSGi land. Let’s walk through some of the stuff you can do now. First of all download and install recently released Apache Karaf 2.0.0.

Now if you want to play with all these stuff before the ActiveMQ 5.4.0 is officially released, you need to edit

${KARAF_HOME}/etc/org.ops4j.pax.url.mvn.cfg

and add

https://repository.apache.org/content/repositories/snapshots/

to the list of available repositories.

Once in the Felix runtime, you can now install all these new “features” by doing something like

karaf@root> features:addUrl mvn:org.apache.activemq/activemq-karaf/5.4-SNAPSHOT/xml/features

Of course, when 5.4.0 is released (and for all newer versions), you should only change the appropriate version in the url above.

You want to install the broker? Easy. Just type

karaf@root> features:install activemq-spring

and it’s there. Also, if you prefer to use Blueprint instead of Spring you can do

karaf@root> features:install activemq-blueprint

Once installed, the broker can be started with

karaf@root> activemq:create-broker

(add --type blueprint if you wish to use blueprint configuration).

Of course, no ActiveMQ installation is complete without Web Console. To monitor our installed broker, we should take the following steps:

  • Install war feature
    karaf@root> features:install war
  • Configure system properties, by adding the following snippet
    webconsole.type=properties
    webconsole.jms.url=tcp://localhost:61616
    webconsole.jmx.url=service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root
    webconsole.jmx.user=karaf
    webconsole.jmx.password=karaf
    

    to etc/system.properties

  • Install and run the web console
    karaf@root> features:install activemq-web-console 

    .

  • Visit the console at http://localhost:8181/activemqweb/ and enjoy.

You can find more detailed information on the topic reading the following article.

Also, if you haven’t already, check the free chapters of ActiveMQ and Camel in Action series books available at FUSESource