Skip to content

ActiveMQ Artemis

ActiveMQ Artemis is a message broker stemming from JBoss' HornetQ, which was donated to the Apache ActiveMQ community. It features a non-blocking architecture, ensuring high performance, flexible clustering, and robust high availability. With its multi-protocol support and adherence to the Java Message Service (JMS) API, it seamlessly integrates with Martini Server Runtime and offers a versatile messaging solution.

Prerequisites

Before configuring Martini Server Runtime to connect with an ActiveMQ Artemis broker, ensure the following prerequisite is met:

  • ActiveMQ Artemis JMS Client Library: Download the ActiveMQ Artemis JMS client library from the Maven Repository. Once obtained, place the library JAR file under <martini-home>/lib/ext/.

Configuration Steps

Follow these instructions to configure Martini Server Runtime to utilize ActiveMQ Artemis as the message broker:

  1. Modify the Configuration File: Navigate to <martini-home>/conf/broker/artemis-external.xml and open the file. Configure the uri, username, and password properties according to your ActiveMQ Artemis setup.

  2. Update the Configuration: By default, Martini utilizes an embedded instance of ActiveMQ. To switch to the ActiveMQ Artemis configuration, edit the <martini-home>/data/override.properties file. Add or modify the following property:

1
jms.configuration-file=artemis-external
  1. Restart Martini: Restart your Martini instance for the configuration changes to take effect. Upon successful restart, verify the connection by accessing the management console under the Connections tab.

Tuning ActiveMQ Artemis

Optimize the performance of ActiveMQ Artemis when used as a broker for Martini Server Runtime with the following tuning recommendations:

Minimize Usage of javax.jms.ObjectMessage

Avoid excessive use of javax.jms.ObjectMessage due to its performance overhead and space consumption. Utilize javax.jms.TextMessage for simpler text-based message exchanges whenever feasible.

Opt for DUPS_OK_ACKNOWLEDGE Mode

Prefer DUPS_OK_ACKNOWLEDGE mode over AUTO_ACKNOWLEDGE to reduce message acknowledgment overhead. Use CLIENT_ACKNOWLEDGE for batch acknowledgments if necessary.

Evaluate Durable Message Necessity

Publish durable messages only when essential, as they demand persistence and consume additional space.

Opt for Default File Store

Utilize ActiveMQ Artemis's default file journal for optimal performance, unless specific requirements necessitate JDBC persistence.

TCP Buffer Size Adjustment

Consider adjusting TCP buffer size for enhanced message exchange performance, especially on fast networks. Ensure alignment with OS auto-tuning if applicable.

JVM Configuration

Optimize JVM memory allocation for ActiveMQ Artemis to enhance performance. Configure JVM arguments -Xms and -Xmx for memory allocation and specify -XX:+UseParallelOldGC for parallel garbage collection.

Manage File Handle Limit

Monitor and adjust the OS's file handle limit as necessary to accommodate ActiveMQ Artemis's concurrent connection demands.

Message Size Optimization

Optimize message size to minimize throughput impact and enhance message transfer efficiency.

For additional optimization techniques, refer to the official performance tuning documentation provided by ActiveMQ Artemis.