Message Queue Installation

Prerequisites for the following products

The Product 360 MessageQueue is a prerequisite for Product 360, and has to be installed before it. Additionally the P360 MessageQueue is used for the following products:

  • Product 360 - Media Manager

Installing the Apache Message Queue 5.x.x

The procedure for setting up the Apache Message Queue 5.x.x for Windows is as follows:

  1. Uncompress PIM_<Version>_ThirdPartySoftware.zip from your Product 360 8.0 distribution to your local computer

  2. Navigate to the directory \ActiveMQ 5.x.x.

  3. Unpack the file MessageQueue*.zip to C:\. (or any other folder)

  4. Run Command Prompt as Administrator, navigate to C:\MessageQueue and launch the application using the script startup64.bat.

  5. To manage the Message Queue use the following link: http://localhost:8161/admin/ and type in admin for user and password.

  6. For checking the entries use the following link: http://localhost:8161/admin/queues.jsp

    To change the connection URL open C:\MessageQueue\conf\activemq.xml and modify this entry:

    <transportConnectors>
    <transportConnector name="openwire" uri="tcp://localhost:61616"/>
    </transportConnectors>

    To change the password for admin open and modify the entry 'admin: admin, admin'

    To change the password for admin open C:\MessageQueue\conf\jetty-realm.properties and modify the entry 'admin: admin, admin' formatting as 'username: password, role'.

    To disable this webconsole open C:\MessageQueue\conf\activemq.xml and comment the import of the file jetty.xml:

    original:
    <import resource="jetty.xml"/>
     
    disabled:
    <!--
    <import resource="jetty.xml"/>
    -->

Run Apache Message Queue 5.x.x as a service

  1. Run cmd as Administrator, navigate to C:\MessageQueue\activemq\bin\win32 and execute InstallService.bat

  2. Open the Microsoft service administration.

  3. Open the properties of the "Informatica Product 360 ActiveMQ" service.

  4. On the "General" tab set the startup type to "Automatic".

  5. Click on OK.

  6. Start the service.

With UninstallService.bat the service can be deleted.

Enable the JMX for Apache Message Queue

As the Product 360 with JMX can be enabled by How to enable Java Management Extensions (JMX), the JMX can be also enabled for ActiveMQ to observe and manage the performance.

  1. Open the C:\MessageQueue\activemq\bin\win64\wrapper.conf to enable remote JMX

    # Uncomment to enable remote jmx
    wrapper.java.additional.10=-Dcom.sun.management.jmxremote.port=1616
    wrapper.java.additional.11=-Dcom.sun.management.jmxremote.authenticate=false
    wrapper.java.additional.12=-Dcom.sun.management.jmxremote.ssl=false
  2. Restart the Active MQ server

  3. Connect JMX tool with Active MQ server: start up JConsole or Java VisualVM to set the corresponding parameter(e.g. localhost:1616) for the host, optionally add some display name for the connection.

Security (optional)

You can use SimpleAuthenticationPlugin. With this plugin you can define users and groups directly in the broker's XML configuration (conf/activemq.xml by default). Take a look at the following snippet for example:

SimpleAuthenticationConfiguration
<plugins>
<!-- Configure authentication; Username, passwords and groups -->
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="system" password="${activemq.password}"
groups="users,admins"/>
<authenticationUser username="user" password="${guest.password}"
groups="users"/>
<authenticationUser username="guest" password="${guest.password}" groups="guests"/>
</users>
</simpleAuthenticationPlugin>
<!-- Lets configure a destination based authorization mechanism -->
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" read="admins" write="admins" admin="admins" />
<authorizationEntry queue="USERS.>" read="users" write="users" admin="users" />
<authorizationEntry queue="GUEST.>" read="guests" write="guests,users" admin="guests,users" />
<authorizationEntry queue="TEST.Q" read="guests" write="guests" />
<authorizationEntry topic=">" read="admins" write="admins" admin="admins" />
<authorizationEntry topic="USERS.>" read="users" write="users" admin="users" />
<authorizationEntry topic="GUEST.>" read="guests" write="guests,users" admin="guests,users" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="guests,users" write="guests,users" admin="guests,users"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>

Use SSL over TCP

  1. Add the following entry in the activemq.xml, adjust the port depending on your need

    <transportConnectors>
    [...]
    <transportConnector name="ssl" uri="ssl://0.0.0.0:61617?trace=false&amp;"/>
    </transportConnectors>
  2. Add the certificate "broker-localhost.cert" to all Java keystores which should use this SSL connection with the following command:
    keytool -import -trustcacerts -keystore -storepass -alias activemq -import -file

  3. Restart the ActiveMQ service

  4. Restart the application which uses the updated keystore.

Clustering (optional)

The standard AMQ supports also the clustering topic, for more information please visit the the official Apache web page http://activemq.apache.org/clustering.html.

You can configure the fail over protocol for the JMS connector URL which is used in the Media Manager workflow(JMS client as producer) and Product 360 server(JMS client as consumer), so that a JMS client will connect to one of JMS brokers , then if the JMS broker goes down, it will auto-reconnect to another broker. And you can also create a Network of brokers to store and forward messages between brokers, so that messages could be always consumed even if they arrive at a broker without consumer. Such network can be defined directly in the broker's XML configuration (conf/activemq.xml by default). Take a look at the following snippet for example:

Configuring a network of broker
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
...
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="amq1" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
...
<networkConnectors>
<networkConnector name="amq1-nc"
uri="static:(failover:(tcp://0.0.0.0:61617))"
dynamicOnly="true"
networkTTL="2"
duplex="false">
<!-- excluded audittrail destinations -->
<excludedDestinations>
<queue physicalName="Consumer.ATCS.VirtualTopic.ATCS.ALL"/>
<topic physicalName="VirtualTopic.ATCS.ALL"/>
</excludedDestinations>
</networkConnector>
</networkConnectors>
<persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb"/>
</persistenceAdapter>
...
<transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>
</transportConnectors>
</broker>
<import resource="jetty.xml"/>
</beans>


ActiveMQ client uses failover transport for failover protocol . The Failover transport layers reconnect logic on top of any of the other transports. The configuration syntax allows you to specify any number of composite URIs. The Failover transport randomly chooses one of the composite URIs and attempts to establish a connection to it. If it does not succeed, or if it subsequently fails, a new connection is established choosing one of the other URIs randomly from the list. It retries connecting failover server unlimited number of times if used don't specify maxReconnectPatameters as below. Once max number parameter is passed then it tries maximum number of reconnect attempts before an error is sent back to the client. The below sample queue url shows how to pass maxReconnectAttempts parameter.

queue.default.url = failover://(tcp://host:port)?maxReconnectAttempts=1

More about failover configuration parameters are mentioned in below doc.

https://activemq.apache.org/failover-transport-reference.html

ActiveMQ client library logs retry logic in a debug mode. If you want to enable these debug logger statements then you need to add below logger in log4j2.xml of PIM application.

<Logger name="org.apache.activemq" level="DEBUG" />