com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Input MQTT Event Adapter

MQTT event adapter is an internal event adapter that comes with WSO2 products. 

Prerequisites

Follow the steps below before starting the input MQTT event adapter configuration.

  1. Download MQTT client library (mqtt-client-0.4.0.jar).
  2. Add the file to <PRODUCT_HOME>/repository/components/lib/ directory.

Configuring input MQTT event adapter

You can configure the input MQTT adapter using the management console or using a configuration file.

Configure using the management console

Follow the instructions below to configure input MQTT event adapter using the management console. This deploys the event adapter in the <PRODUCT_HOME>/

repository/deployment/server/inputeventadaptors/ directory.

  1. Log in to product's management console, and click Configure.
  2. Click Input Event Adaptors in the Event Processor Configs menu, and then click Add Input Event Adaptor
  3. Enter details as shown in the below example. 

    create input MQTT event adapter

  4. Click  Add Event Adaptor.

Configure using a configuration file

Follow the instructions below to configure input MQTT event adapter using a configuration file.

  1. Create an XML file with the following MQTT input event adapter configurations. Input event adapter implementation must start with <inputEventAdaptor> as the root element.

    <inputEventAdaptor name="mqttInputEventAdaptor" statistics="disable"
      trace="disable" type="mqtt" xmlns="http://wso2.org/carbon/eventadaptormanager">
      <property name="cleanSession">true</property>
      <property name="url">tcp://localhost:1883</property>
      <property name="keepAlive">70000</property>
    </inputEventAdaptor>
  2. Add the XML file to the <PRODUCT_HOME>/repository/deployment/server/inputeventadaptors/ directory. Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy to/from the server.  

After an adapter is successfully added, it gets added to the list of adapters displayed under Event Processor Configs in the Configure menu of the product's management console. Click Edit to change its configuration and redeploy it. This opens an XML-based editor allowing you to edit the event adapter configurations from the UI.  Do your modifications and click Update. You can also delete it, enable/disable statistics or enable/disable tracing on it using the provided options in the UI.

Configuring input MQTT event adaptor message properties

The configured input event adapters are used in event builders. With input event adaptor message properties, event builders are able to extract data from the incoming events to build the event streams. Message properties specific to input event adapters of the mqtt type can be configured as follows.

  1. Log into the BAM Management Console. For detailed instructions, see Running the Product.
  2. In the Main tab, click Event Streams to open the Available Event Streams page.
  3. Click the Inflows link of the event stream to which the relevant input event adapter is connected. As a result, Event In-Flows (<Input_Event_Adapter_Name>) opens.
  4. Click on the relevant event builder name to open the Event Builder Details page.
    input MQTT event adapter message propertiesThe message properties of an mqtt input event adapter are described below.  Change the property values as required.

    PropertyDescription
    TopicThe topic that will be used to receive messages on the MQTT input adapter
    Client IdUnique client ID used for communication. You cannot have duplicated client IDs for the same MQTT broker.
    Input Mapping TypeThe incoming event type to be mapped. 
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.