ActiveMQ Server for Debian
==========================

Disabled features
-----------------
This package doesn't contains (yet) all features provided by upstream
as some dependencies are missing from Debian.
For a list of disabled modules, you can look at
  /usr/share/doc/libactivemq-java/README.Debian


Upgrading from previous versions (SysV init → systemd)
-------------------------------------------------------

ActiveMQ now uses a systemd template unit (activemq@.service) instead of the
System V init script. On upgrade, any instance that was previously enabled
via /etc/activemq/instances-enabled/ is automatically migrated: the
corresponding systemd unit is enabled and started for you.

The old sysvinit init script is disabled automatically during the upgrade.

To manually enable an instance after the upgrade:

  systemctl enable --now activemq@<instancename>

For example, to enable the default "main" instance:

  systemctl enable --now activemq@main


Main ActiveMQ instance
----------------------
This package provides a default ("main") instance for ActiveMQ.

As of now, this instance only listens on the loopback interface (127.0.0.1)
on port 61616, with OpenWire protocol enabled.
Message storage is handled by KahaDB in /var/lib/activemq/main/data/kahadb.

Its XML configuration can be edited here:
  /etc/activemq/instances-available/main/activemq.xml

Enable and start it:
  ln -s /etc/activemq/instances-available/main \
    /etc/activemq/instances-enabled/main
  systemctl enable --now activemq@main

Check its status:
  systemctl status activemq@main


JVM options
-----------

JVM memory settings and other Java system properties for all instances can be
configured globally in /etc/default/activemq by setting ACTIVEMQ_OPTS:

  ACTIVEMQ_OPTS="-Xms512M -Xmx1G"


Debug an ActiveMQ instance
--------------------------

To start an instance in the foreground for debugging, stop the systemd unit
first and then invoke the activemq script directly as the activemq user:

  systemctl stop activemq@<instancename>
  sudo -u activemq /usr/bin/activemq console \
    xbean:file:/etc/activemq/instances-enabled/<instancename>/activemq.xml


Setup a new ActiveMQ instance
------------------------------

To create a new instance:

1. Create the configuration directory and provide an activemq.xml:

     mkdir /etc/activemq/instances-available/<instancename>
     cp /etc/activemq/instances-available/main/activemq.xml \
       /etc/activemq/instances-available/<instancename>/

2. Enable the instance:

     ln -s /etc/activemq/instances-available/<instancename> \
       /etc/activemq/instances-enabled/<instancename>

3. Start and enable it with systemd:

     systemctl enable --now activemq@<instancename>
