- 06 Jun 2022
- 4 Minutes to read
- Updated on 06 Jun 2022
- 4 Minutes to read
|Settings Location||System > Settings > ActiveMQ Settings|
The ActiveMQ module allows users to integrate with Apache ActiveMQ. ActiveMQ is an open-source, multi-protocol messaging service.
Active MQ Settings
- In Decisions Studio, navigate to System > Settings. Right-click Active MQSettings and select Edit.
- On the Edit Active MQSettingswindow, enter the configuration settings for ActiveMQ and click SAVE.
Setting Description Default Server IP or Name The IP address or the server name that hosts the queue. Use Default Port Uses the default port assigned for ActiveMQ. Use Failover with Connection Allows a different host connection to be used in case of a failover event. Failover Server IP or Name The IP address or name of the failover host. Default Virtual Host The default virtual host used by ActiveMQ. Default User Name The user name used to connect to ActiveMQ. Default Password The default password used to connect to ActiveMQ. Default Protocol Defines the transport protocol Decisions will use when connecting to the queue OpenWire Uses OpenWire as the protocol to establish access to the message queue. AMQP 1.0 Uses AMQP 1.0 protocol to establish access to the message queue
Connecting to an ActiveMQ
- Navigate to System > Jobs and Events > Message Queues and click ADD ACTIVE QUEUE.
- On the Add Active Queue window, configure the settings for the message queue.
Setting Decription Display Name The name for the message queue in Decisions Queue Name The name of the Message Queue Override Server Info Overrides the Server Information defined in ActiveMQ Settings Persistent Messages Allows messages to exist when the message broker is restarted In Address Uses the same name defined in Queue Name Out Address Uses the same name define in Queue Name Protocol Defines the transport protocol Decisions will use when connecting to the queue OpenWire Uses OpenWire as the protocol to establish access to the message queue AMQP 1.0 Uses AMQP 1.0 protocol to establish access to the message queue AMQP+TLS Enables SSL connections through AMQP to the message queue Override Queue Credentials Overrides the credentials defined in ActiveMQ settings
- 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.
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.
- In the Windows search bar, search for and open Edit the System Environment Variables.
- 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.
- 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.
- Create auth certificate set for ActiveMQ by running the .bat file prerequisite mentioned in the callout above.
- In the Windows search bar, search for and open Windows Powershell as an Administrator. Run the following commands in order. Afterwards, close Powershell.
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
- 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>
- 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"/>
- 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.
- In the Certificate Import Wizard, select Next then Browse. Select the certificate file generated earlier "client.p12" found under ActiveMQ > certs. Select Next.
- Type the password for the certificate. This example uses the default "password" as configured in step 6. Select Next, Next again, and then Finish.
- Navigate to Trusted Root Certificate Authorities > Certificates. Right-click on Certificates, then select All Tasks > Import.
- 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
- Open the Decisions instance and ensure the ActiveMQ module is installed. Navigate to System > Jobs and Events > Message Queues then select Add Active Queue.
- In the Add Active Queue window, provide names and in/our addresses for ActiveMQ.
- Set Override Server Info to True. Enter the server IP e.g. localhost.
- Set Use Default Port to False. Enter the port number of the ActiveMQ instance e.g. 5671. Ensure this port is available.
- For Protocol. select AMQP+TLS to use SSL for this ActiveMQ messaging queue.
- 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.