Community Server - nicho92/MtgDesktopCompanion GitHub Wiki

ActiveMQ Server

This document explains how to use the ActiveMQServer feature in MTG Desktop Companion.

What it does

ActiveMQServer starts an embedded Apache ActiveMQ Artemis message broker inside the application. It is used to:

  • receive chat and technical messages,
  • manage channels (topics) used by clients,
  • track online players,
  • broadcast player/channel updates to connected clients.

Default behavior

When enabled, the server:

  • listens on tcp://<internal-ip>:61616,
  • enables the default topic welcome,
  • can also load extra topics from configuration,
  • stores broker data (journal, paging, bindings, etc.) in a local ActiveMQ data directory,
  • starts an internal bot user (ActiveBot) that joins the default topic,
  • records messages and connection/disconnection events in technical storage.

Configuration options

You can configure the following properties for ActiveMQServer:

Property Default Description
ENABLE_JMX_MNG true Enables JMX management for the broker.
LISTENERS_TCP tcp://<internal-ip>:61616 Comma-separated list of TCP listeners.
SECURITY_ENABLED false Turns broker security on/off.
LOG_DIR <data-dir>/activemq Directory used for broker persistence/log data.
ADRESSES welcome Comma-separated list of messaging addresses (topics).
RETENTION_DAYS 7 Journal retention period, in days.
AUTOSTART false Starts the server automatically at application startup.

Note: the property key is spelled ADRESSES in code/config (single "d" after "A").

Typical setup

  1. Open the server configuration screen in the application.
  2. Enable AUTOSTART if you want it available every launch.
  3. Confirm LISTENERS_TCP is reachable by your clients (host/IP and port).
  4. Add additional channels in ADRESSES if needed.
  5. Save and start the server.

Administration console

Run the SERVER-Artemis_Console for Hawtio administration console

How clients connect

Clients using the ActiveMQNetworkClient provider connect to one broker URL and one address/topic.

Typical connection values:

  • Broker URL: tcp://<server-ip>:61616
  • Topic/address: welcome (or one configured in ADRESSES)

Runtime events you can expect

  • New session created: connection event is logged and stored.
  • Session closed: user is removed from online users list.
  • Message sent: message is stored and online user/channel updates can be broadcast.

Operational notes

  • If SECURITY_ENABLED=false, user/password checks are effectively permissive.
  • Online tracking excludes admin users from the public online user list.
  • The server is considered healthy when isAlive() returns true (broker started).

Troubleshooting

Server will not start

Check:

  • listener URL syntax in LISTENERS_TCP,
  • whether port 61616 is already in use,
  • write permissions for LOG_DIR.

Clients cannot receive messages

Check:

  • client and server are using the same address/topic,
  • network/firewall access to the broker port,
  • consumer is not intentionally disabled.

No online users shown

Check:

  • users are connecting with non-admin profiles,
  • disconnection events are not immediately removing them,
  • clients are sending status updates/messages after connecting.

If you want, this guide can also be expanded into an operator/admin version with monitoring checks, backup/retention strategy, and a security-hardening section.

⚠️ **GitHub.com Fallback** ⚠️