Skip to content

Configuring ActiveMQ Artemis for Martini

ActiveMQ Artemis can be seamlessly integrated with the Martini Server Runtime, enabling efficient communication between applications through its advanced messaging capabilities. This integration allows users to take advantage of Artemis's high-performance architecture and features such as support for multiple protocols, improved clustering, and built-in high availability options. By configuring the connection settings, developers can leverage the external Artemis broker for sending and receiving messages, significantly enhancing the scalability and reliability of their messaging workflows. This setup not only optimizes message delivery but also simplifies the architecture, making it easier to manage and scale applications in dynamic environments.

Prerequisites

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

  • Apache ActiveMQ Artemis: Ensure your message broker is running. You can follow guides for setup here: Standalone | Docker Container.
  • Apache ActiveMQ Artemis JMS Client Library: Download the ActiveMQ Artemis JMS client library from the Maven Repository. Take note that Martini Server Runtime does not accept versions 2.32.x above. Once obtained, place the library JAR file under <martini-home>/lib/ext.

Connect to a remote ActiveMQ Artemis instance

  1. Configure Martini's connection properties in the <martini-home>/conf/overrides/override.properties. Configuration properties: These properties represent the bare minimum requirements needed to get started with the application.

    1
    2
    3
    jms.configuration-file=artemis-external
    # The URL of the remote broker. 
    artemis.uri=tcp://[HOST]:61616
    

    Authentication properties: If you are using the default credentials, you can skip the following properties. For guidance on setting up authentication, refer to the documentation here.

    1
    2
    3
    4
    5
    6
    # Sets the login when connecting to a remote Artemis broker.
    # If unspecified, Martini will use 'guest' for the login.
    artemis.username=[username]
    # Sets the password when connecting to a remote Artemis broker.
    # If unspecified, Martini will use 'guest' for the password.
    artemis.password=[password]
    

    Optional properties: These settings will prevent Martini colliding with different instances with the default properties.

    1
    2
    3
    4
    5
    6
    # The value of this property must be unique among clients connected to the ActiveMQ instance.
    # This is used to identify the name of the Martini instance in the ActiveMQ connections.
    jms.client-id=[client-id]
    # The prefix is added to mitigate overlapping JMS destinations and to distinguish between different Martini instances connected to a single message broker.
    # It adds a prefix to the beginning of a queue and topic; for example: `your-prefix.io.lonti.martini`
    jms.destination-prefix=your-prefix
    
  2. Restart Martini Server Runtime to apply the changes.

  3. Verify connection establishment.
1
INFO [MartiniBrokerConfiguration] Using broker configuration at '<martini-home>/conf/broker/artemis-external.xml'

Testing

Refer to JMS Messaging to learn more about sending and receiving JMS messages.

ActiveMQ Artemis Configuration

Refer to Apache documentation for detailed configuration instructions on ActiveMQ Artemis.