ActiveMQ SBT Plugin

2014-08-29

Simple auto plugin to run activemq from sbt

Features

These are the features of this small plugin:

  • Register multiple broker URIs
  • Start / Stop / Restart brokers
  • List registered URI

Configuration

The plugin is written as a

Add this to your `plugins.sbt'

addSbtPlugin("com.edc4it" % "sbt-activemq" % "1.0.0-SNAPSHOT")

And this to your `build.sbt' (or similar in your build definition)

val root = (project in file(".")).enablePlugins(SbtActiveMQ)

amqBrokers += ("sample" -> "broker:tcp://localhost:17171")

You can add multiple Broker URIs.

Using

Once you start the sbt console you can the following

  • List the registered Broker URIs:
default STOPPED broker:tcp://localhost:61616
sample  STOPPED broker:tcp://localhost:17171

[success] Total time: 0 s, ...
  • Start a broker (using completion for the names)
amqStart default
[success] Total time: 0 s,
  • Stop a broker
amqStop default
[success] Total time: 0 s,

Notes

Some important notes (some will need to be

  • The broker starts a random port for the JMX use netstat to see which one
  • The data directory is set to .activemq-data/«name»
This article does not necessarily reflect the technical opinion of EDC4IT, but purely of the writer. If you want to discuss about this content, please use thecontact ussection of the site