Independent ActiveMQ handbook · archive of the 2004–2007 project site
Independent guide. Not the Apache ActiveMQ project site and not affiliated with the Apache Software Foundation. ActiveMQ and Apache are trademarks of the ASF. Official documentation: activemq.apache.org.

activemq.org › Handbook › ActiveMQ ports: defaults and how to change them

Handbook

ActiveMQ ports: defaults and how to change them

Checked against ActiveMQ Classic 6.4.0, 6.3.3 and 5.19.12 and Apache Artemis 2.57.0 on . Independent guide; sources are listed at the end. Official documentation: activemq.apache.org and artemis.apache.org.

ActiveMQ's default port is 61616, used by OpenWire, the broker's native protocol, and the web console runs on port 8161. In the default configuration of ActiveMQ 6.4.0 and 5.19.12, 61616 is the only messaging port that is switched on: the AMQP (5672), STOMP (61613), MQTT (1883) and WebSocket (61614) connectors are present in conf/activemq.xml but commented out.

This page covers ActiveMQ, also called ActiveMQ Classic, and is based on the default configuration files in the 6.4.0 and 5.19.12 release tags of the project's GitHub repository (listed under Sources). The official documentation is at activemq.apache.org.

ActiveMQ default ports

PortWhat uses itDefined inOn by default (6.4.0, 5.19.12)
61616OpenWire (JMS clients, other brokers)conf/activemq.xml, connector openwireYes, on all interfaces
5672AMQPconf/activemq.xml, connector amqpNo, commented out
61613STOMPconf/activemq.xml, connector stompNo, commented out
1883MQTTconf/activemq.xml, connector mqttNo, commented out
61614WebSocket (ws://)conf/activemq.xml, connector wsNo, commented out
8161Web console and REST API (HTTP)conf/jetty-spring.properties (6.4.0), conf/jetty.xml (5.19.x)Yes, on 127.0.0.1 only
8443Web console over HTTPS (6.4.0)conf/jetty-spring.propertiesNo (httpsEnabled=false)
noneRemote JMXbin/setenv (6.4.0)No; a commented example uses 11099

The transport connectors in conf/activemq.xml

Every messaging port is a <transportConnector> element inside <transportConnectors>. From the default conf/activemq.xml in ActiveMQ 6.4.0 (the 5.19.12 file has the same five lines):

<transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=10485760"/>
<!-- <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=10485760"/> -->
<!-- <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=10485760"/> -->
<!-- <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=10485760"/> -->
<!-- <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=10485760"/> -->

A few things to read from those lines:

  • The scheme picks the protocol. tcp:// is OpenWire; amqp://, stomp://, mqtt:// and ws:// select the other protocols.
  • 0.0.0.0 means the connector accepts connections on every network interface, unlike the web console, which is bound to 127.0.0.1.
  • The two options are the file's own denial-of-service guard: at most 1,000 concurrent connections and a 10 MB maximum frame size per connector.
  • The extra protocols are off on purpose. A comment in the file says they are disabled to reduce the exposed attack surface, and asks you to enable only the protocols you need, preferring the secured variants (openwire+ssl, amqp+ssl, stomp+ssl, mqtt+nio+ssl, wss) in production.
  • Plain 61616 is unencrypted. The comment above the OpenWire line says it is intended for initial testing, and recommends the ssl:// variant in production so that credentials and messages are not sent in cleartext.

If a tutorial tells you the broker answers on 5672 or 61613 straight after installation, check your own conf/activemq.xml: in 6.4.0 and 5.19.12 those connectors stay off until you uncomment them.

What is port 8161?

Port 8161 belongs to the embedded Jetty web server that serves the ActiveMQ web console at /admin and the REST APIs. It is configured separately from the messaging connectors above. In 6.4.0 and 5.19.12 it listens on 127.0.0.1, so it is reachable only from the broker machine until you change the bind address. From conf/jetty-spring.properties in ActiveMQ 6.4.0:

jetty.http.host=127.0.0.1
jetty.ssl.host=127.0.0.1
jetty.http.port=8161
jetty.ssl.port=8443

In 5.19.x the same two values are the host and port properties of the jettyPort bean in conf/jetty.xml.

How do I check that ActiveMQ is listening on a port?

The official getting-started guide uses netstat. On Windows:

netstat -an|find "61616"

From a Unix shell:

netstat -nl|grep 61616

Replace 61616 with 8161, 5672 or any other port to check it. If 61616 is missing, the broker did not start or could not open the port (for example because another process already uses it); the broker log, data/activemq.log, records the startup. If 8161 shows only 127.0.0.1, that is the default loopback binding, not a fault.

How do I change an ActiveMQ port?

  1. Stop the broker.
  2. Open conf/activemq.xml and edit the port inside the uri of the connector you want to move. For example, to move OpenWire to 61626:
    <transportConnector name="openwire" uri="tcp://0.0.0.0:61626?maximumConnections=1000&amp;wireFormat.maxFrameSize=10485760"/>
  3. To enable another protocol, remove the <!-- and --> around its line and change the port if you need to.
  4. Start the broker and check the port with netstat as above.
  5. Update every client's broker URL, firewall rule and container port mapping to the new number.

The web console port is changed separately: jetty.http.port in conf/jetty-spring.properties (6.4.0) or the jettyPort bean in conf/jetty.xml (5.19.x).

One port for several protocols

Since ActiveMQ 5.13.0 the auto transport can detect OpenWire, STOMP, AMQP and MQTT on a single port, so all four kinds of client can share one connector. The official example:

<transportConnector name="auto" uri="auto://localhost:5671"/>

There are also auto+ssl, auto+nio and auto+nio+ssl variants. Protocol details are in STOMP and OpenWire and AMQP.

Remote JMX port

No JMX port is opened by default. The default activemq.xml tells the broker not to create its own JMX connector (createConnector="false"), and the 6.4.0 bin/setenv file sets -Dcom.sun.management.jmxremote without a port. The lines that would open a remote JMX port are commented out and use 11099 as the example. See ActiveMQ monitoring before opening one.

Ports in Docker and on Artemis

Running the broker in a container adds port publishing on top of everything above; ActiveMQ in Docker covers the mappings and the console's bind address. Apache Artemis (formerly ActiveMQ Artemis) does not use activemq.xml: it defines listeners as <acceptor> elements in broker.xml, where the default value of the port parameter is also 61616. The differences are covered in ActiveMQ Classic vs Artemis.

The 2006 archive page on configuring transports and the 2006 archive page on the TCP transport show how transports were configured in the project's early years.

Frequently asked questions

What port does ActiveMQ use?

61616 for OpenWire, the native protocol that JMS clients use, plus 8161 for the web console. In the 6.4.0 and 5.19.12 default configuration those are the only ports opened.

What is port 8161 in ActiveMQ?

It is the embedded Jetty web server for the web console at /admin and the REST APIs. By default it listens on 127.0.0.1 only.

Does ActiveMQ listen on 5672 and 61613 by default?

Not in 6.4.0 or 5.19.12. The AMQP (5672), STOMP (61613), MQTT (1883) and WebSocket (61614) connectors are in conf/activemq.xml but commented out; uncomment the ones you need.

How do I check if ActiveMQ is listening on port 61616?

Run netstat -an|find "61616" on Windows or netstat -nl|grep 61616 on Linux and macOS, as the official getting-started guide shows.

How do I change the ActiveMQ port?

Edit the port in the uri of the transportConnector in conf/activemq.xml and restart the broker. The console port is jetty.http.port in conf/jetty-spring.properties (6.4.0) or the jettyPort bean in conf/jetty.xml (5.19.x).

Related guides

From the 2006 archive

The original ActiveMQ documentation on these topics, kept as it was published here in 2004–2007. It describes ActiveMQ 4.x and older.

Sources

  1. ActiveMQ 6.4.0 default conf/activemq.xml (GitHub) raw.githubusercontent.com
  2. ActiveMQ 5.19.12 default conf/activemq.xml (GitHub) raw.githubusercontent.com
  3. ActiveMQ 6.4.0 conf/jetty-spring.properties (GitHub) raw.githubusercontent.com
  4. ActiveMQ 5.19.12 conf/jetty.xml (GitHub) raw.githubusercontent.com
  5. ActiveMQ 6.4.0 bin/setenv (GitHub) raw.githubusercontent.com
  6. ActiveMQ Classic: Getting Started activemq.apache.org
  7. ActiveMQ Classic: AUTO transport activemq.apache.org
  8. Apache Artemis: Configuring the Transport artemis.apache.org