FactoryLogix Learning

CFX configuration with RabbitMQ

KB ARTICLE

Overview

This article describes how to install and configure RabbitMQ as a message broker for CFX integration with FactoryLogix.

Prerequisites

  • Administrator access to the xLink server.

  • The latest RabbitMQ installer and the corresponding Erlang Runtime installer.

Install RabbitMQ and Erlang

  1. Download the latest RabbitMQ installer and the required Erlang Runtime.

  2. Install Erlang Runtime first, then install RabbitMQ (the RabbitMQ service starts automatically after installation).

Enable required RabbitMQ plugins and create the admin user

  1. Open RabbitMQ Command Prompt as Administrator (found under RabbitMQ in the Start menu).

  2. Run the following commands in sequence to enable management and AMQP 1.0 plugins, and to create an administrator user:

rabbitmq-plugins.bat enable rabbitmq_management
rabbitmq-plugins.bat enable rabbitmq_amqp1_0
rabbitmqctl.bat add_user admin admin
rabbitmqctl.bat set_user_tags admin administrator
rabbitmqctl.bat set_permissions -p / admin ".*" ".*" ".*"

Configure RabbitMQ to use port 5675

To change the default AMQP port to 5675, add a Windows environment variable. Navigate to Start > Settings > Control Panel > System > Advanced > Environment Variables, add the system variable, then restart the RabbitMQ service.

Note: For full details on customizing RabbitMQ environment variables, see https://www.rabbitmq.com/configure.html#customise-environment .

Verify the management interface and open firewall ports

  1. Open the RabbitMQ management interface at http://localhost:15672 (you must access this from localhost because the default guest credentials only allow local connections).

  2. In the Admin section, confirm that the admin user has permission to use AMQP 1.0.

  3. In the Overview section, confirm that AMQP is running on port 5675.

  4. Open ports 5675 and 15672 in Windows Firewall on the xLink server.

Create the CFX exchange and queues

  1. Create an exchange named CFXExchange with type Fanout.

  2. Create a queue named Data.

  3. Bind the Data queue to the CFXExchange exchange: select the Data queue link, select Bindings, and enter CFXExchange in the Exchange field.

  4. Create a separate queue for each CFX handle used by the connected machines.

Configure the machine connection

When configuring each machine, use the following values:

Field

Value

Broker address

amqp://[xlink server]:5675

Exchange

/exchange/CFXExchange

Queue

/queue/[handle]

Verify the connection by checking the Data queue in RabbitMQ. If heartbeats are being received, the message count will increase. Use Get Message to inspect individual messages.

Configure FactoryLogix to connect to RabbitMQ

  1. In FactoryLogix Settings, add the license server address to the primary license field (the xLink service uses this to obtain the CFX license).

  2. Configure and start the Real-time Service in FactoryLogix Settings.

  3. Enable the CFX log.

  4. In Factory Resources, enter the CFX handle from the machine in the CFX Handle field for the corresponding workstation, and set the subscriber queue to /queue/[handle].

  5. In CFX options, change the Listener Handle from Aegis.FactoryLogix.Listener to /exchange/CFXExchange.

  6. Add the CFX xLink adapter and select the external broker option.

  7. Set the following connection values:

    • Set the Source Host to amqp://localhost:5675

    • Set the Source Address to /queue/Data

    • Set the Source Username to admin

    • Set the Source Password to admin.

  8. Restart the xLink service with the CFX adapter enabled.

  9. Monitor the SVCLOG to confirm the xLink service connects to the broker and monitor the APPLOG and CFX log to verify heartbeats are being received.

Warning

CFX and RabbitMQ configuration values are case-sensitive. Verify that exchange names, queue names, and handle values use the correct case throughout.