App Connect

 View Only

Using the IBM App Connect Enterprise MQTTSubscribe node to subscribe to OPC UA PubSub data, which is published using the MQTT protocol

By Pradeep Patel posted Wed October 18, 2023 09:35 AM

  

IBM App Connect Manufacturing OPC-UA nodes integrate OPC-UA servers with IBM App Connect Enterprise standard applications. 
The OPC-UA Specification (Part 14) for PubSub describes the PubSub communication model.
The IBM App Connect Enterprise MQTTSubscribe node allows applications to connect to publishers that publish OPC-UA PubSub messages.

You can use the built-in MQTTSubscribe node to subscribe to the relevant topics of an MQTT broker that will receive messages from the OPC UA Publisher.

Objective

You can create message flows to receive an MQTT message by using the MQTTSubscribe node.
The MQTTSubscribe node subscribes to one or more topics, which you specify, on an MQTT server, and propagates the received messages in a message flow.

Environment

Ensure that you complete the following tasks:

  • Install IBM® App Connect Enterprise 12.0.4.0 or the later modification levels and configure the IBM App Connect Enterprise Toolkit.
  • Install IBM App Connect for Manufacturing V3.0.1.0 and complete all the post installation tasks.

Note: Keep your IBM App Connect for Manufacturing environment that is running at the latest fix level to ensure problem-free operation and to get enhancements and new functionality. The latest fix pack version is 3.0.1.2.

For more information, see Release summary - IBM Documentation.

Steps

The following steps show you how to configure and use the MQTTSubscribe node in a message flow. In this example, an MQTT Subscriber node and a FileOutput node is used to create the message flow to receive an MQTT message.

  1. Click the MQTT drawer from the Palette view and drag the MQTTSubscribe node to the Flow Exerciser.
  2. Click the File drawer from the Palette view and drag the FileOutput node to the Flow Exerciser.
  3. Connect the MQTTSubscribe node’s Out terminal to the File Output node's In terminal.
    The output terminal is used to send successful client item readings.
    The input terminal is used to accept a message for processing by the node.
  4. Click the Properties tab to set the node properties.
    The node properties are organized into related groups and displayed on tabs. Each tab is listed on the left of the Properties view.
  5. Click the Basic tab and add the MQTTSubscribe mandatory properties.

    For more information, see MQTTSubscribe node property details.
    You can get the MQTTSubscribe property values, such as the topic name, hostname, and port number, from the publisher of the MQTT message.

    For example:
    MQTT Publisher
  6. Optional: If you need to connect to a secure MQTT broker that has a username and password authentication, perform the following steps:

    • You need to configure the security identity object, which contains the username and password to be used to authenticate the connection to the  MQTT server. You can configure the secure storage vault for the integration server to store the username and password. For more information, see Configuring vault-enabled integration server - IBM Documentation.
    • Provide the Security identify value in the MQTTSubscribe Node Properties pane.

  7. Deploy the message flow that you have constructed. For more information, see Deploying the flows - IBM Documentation.

Example:

The following example is a snippet of the MQTT Subscriber message flow output file:

{"MessageId":"62c7c588-3623-4ed2-9446-334543b263aa","MessageType":"ua-data","PublisherId":"urn:<complete_hostname>:OPCUA:SimulationServer","Messages":[{"Payload":{"Counter":{"Type":6,"Body":22},"Random":{"Type":11,"Body":-0.6361154},"Sawtooth":{"Type":11,"Body":-1.2},"Sinusoid":{"Type":11,"Body":1.989044},"Square":{"Type":11,"Body":2.0},"Triangle":{"Type":11,"Body":1.866667}}}]} 
It contains: MessageId, MessageType, PublisherId, Messages-Payload 

Related Information

IBM App Connect for Manufacturing
IBM App Connect Enterprise software


#AppConnect
#ACEManufacturing
#MQTT
#AppConnectEnterprise(ACE)
0 comments
23 views

Permalink