ActiveMQ Module
  • 06 Jun 2022
  • 4 Minutes to read
  • Dark
    Light

ActiveMQ Module

  • Dark
    Light

Overview

Module Details

Installation LocationCore
Restart Required?No
Step Location N/A
Settings Location System > Settings > ActiveMQ Settings
Prerequisites

The ActiveMQ module allows users to integrate with Apache ActiveMQ. ActiveMQ is an open-source, multi-protocol messaging service.











Active MQ Settings

  1. In Decisions Studio, navigate to System > Settings. Right-click Active MQSettings and select Edit.
  2. On the Edit Active MQSettingswindow, enter the configuration settings for ActiveMQ and click SAVE.
    SettingDescription
    Default Server IP or NameThe IP address or the server name that hosts the queue.
    Use Default PortUses the default port assigned for ActiveMQ.
    Use Failover with ConnectionAllows a different host connection to be used in case of a failover event.
    Failover Server IP or NameThe IP address or name of the failover host.
    Default Virtual HostThe default virtual host used by ActiveMQ.
    Default User NameThe user name used to connect to ActiveMQ.
    Default PasswordThe default password used to connect to ActiveMQ.
    Default ProtocolDefines the transport protocol Decisions will use when connecting to the queue

    OpenWireUses OpenWire as the protocol to establish access to the message queue.
    AMQP 1.0Uses AMQP 1.0 protocol to establish access to the message queue


Connecting to an ActiveMQ

  1. Navigate to System > Jobs and Events > Message Queues and click ADD ACTIVE QUEUE.
  2. On the Add Active Queue window, configure the settings for the message queue.
    SettingDecription
    Display NameThe name for the message queue in Decisions
    Queue NameThe name of the Message Queue
    Override Server InfoOverrides the Server Information defined in ActiveMQ Settings
    Persistent MessagesAllows messages to exist when the message broker is restarted
    In AddressUses the same name defined in Queue Name
    Out AddressUses the same name define in Queue Name
    ProtocolDefines the transport protocol Decisions will use when connecting to the queue

    OpenWireUses OpenWire as the protocol to establish access to the message queue
    AMQP 1.0Uses AMQP 1.0 protocol to establish access to the message queue
    AMQP+TLSEnables SSL connections through AMQP to the message queue
    Override Queue CredentialsOverrides the credentials defined in ActiveMQ settings

  3. Navigate to System > Jobs and Events > Message Queue Handlers. Click ADD MESSAGE HANDLER and set up a new Message Handler to process or send messages to the queue.

AMQP+SSL Configuration

Prerequisites

Download the following before starting the example configuration.

  • Download ActiveMQ on the machine and save it to the C:/ drive
  • Download JavaSDK
  • Download ActiveMQ module on the Decisions instance
  • Download the certificate generating script to create SSL authorization certificates for ActiveMQ. This file is currently configured for a local install, so please edit this to fit specific connection needs.

Users may set up SSL on an ActiveMQ server. The following example provides a walkthrough of a local installation.

Creating Credentials

  1. In the Windows search bar, search for and open Edit the System Environment Variables.
  2. In the default Advanced tab, select Environment Variables... then click New to create a new environment variable. Name it JAVA_HOME and for the file path to the JavaSDK for the value e.g. "C:\Program Files\Java\jdk-17.0.2".

    Select OK to confirm variable creation. It will then appear in the System Variables table.
  3. Find the Path variable in the System Variables. Select and edit it to view the variable. Scroll to the bottom of the variable and add these two lines in order: %path% and %JAVA_HOME%\bin. Select OK to confirm the edit.
  4. Create auth certificate set for ActiveMQ by running the .bat file prerequisite mentioned in the callout above.
  5. In the Windows search bar, search for and open Windows Powershell as an Administrator. Run the following commands in order. Afterwards, close Powershell.
    cd C:\activemq
    keytool -export -rfc -alias broker -keystore .\certs\broker-jks.keystore -file .\certs\broker_cert.pem -keypass password -storepass password
    keytool -storetype jks -keystore .\certs\broker-jks.truststore -storepass password -keypass password -importcert -alias ca -file .\certs\broker_cert.pem -noprompt
  6. In the ActiveMQ folder, open the conf folder then edit the 'activemq.xml' file in Notepad++ or any other text editor. After the <broker> tags in line 34, add the following tag:

    Edit the keyStore and trustStore password values to provide different credentials.
    <sslContext>
              <sslContext
                keyStore="c:/activemq/certs/broker-jks.keystore" keyStorePassword="password"
                trustStore="c:/activemq/certs/broker-jks.truststore" trustStorePassword="password" />
            </sslContext>
  7. Scroll down to after the <transportConnectors> tag and add the follow line to appear as the first transportConnector. Save and close the text editor.
    <transportConnector name="amqps" uri="amqp+ssl://0.0.0.0:5671?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
  8. In the Windows search bar, search for and open Manage Computer Certificates. Navigate to Personal > Certificates. Right-click on Certificates, then select All Tasks > Import.
  9. In the Certificate Import Wizard, select Next then Browse. Select the certificate file generated earlier "client.p12" found under ActiveMQ > certs. Select Next.
  10. Type the password for the certificate. This example uses the default "password" as configured in step 6. Select Next, Next again, and then Finish.
  11. Navigate to Trusted Root Certificate Authorities > Certificates. Right-click on Certificates, then select All Tasks > Import.
  12. In the Certificate Import Wizard, select Next then Browse. Select the trusted root authority certificate "broker_cert.pem" found under ActiveMQ > certs. Select Next, Next again, and then Finish.

Creating the Decisions Queue

  1. Open the Decisions instance and ensure the ActiveMQ module is installed. Navigate to System > Jobs and Events > Message Queues then select Add Active Queue.
  2. In the Add Active Queue window, provide names and in/our addresses for ActiveMQ.
  3. Set Override Server Info to True. Enter the server IP e.g. localhost.
  4. Set Use Default Port to False. Enter the port number of the ActiveMQ instance e.g. 5671. Ensure this port is available.
  5. For Protocol. select AMQP+TLS to use SSL for this ActiveMQ messaging queue. 
  6. Set Override Queue Credentials to True. In the User Name and Password field, enter the credentials defined in the .bat file. For this example, both of these settings accept the value "admin". Select SAVE to confirm queue creation.

Any messages now sending to this queue via a Message Handler Flow also appear in ActiveMQ under the given queue name.


For further information on Modules, visit the Decisions Forum.

Was this article helpful?

What's Next