Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Excerpt
hiddentrue

NOTE TO WRITERS: Add the TOC here.

Table of Contents
maxLevel3

Prerequisites

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

...

Configuring input MQTT event adapter

Follow the below steps to You can configure the input MQTT adapter using the management console or using a configuration file.

Anchor
Using the management console
Using the management console

...

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 Event Processor Configs in the  Configure menuclick Configure.
  2. Click Add Input Event Adaptor in the Input Event Adaptors menu.   Event Adaptors in the Event Processor Configs menu, and then click Add Input Event Adaptor
  3. Enter details as shown in the below example. 


    Following values are used in the configuration above example:

  4. Event Adaptor Name: mqttInputEventAdaptor 

  5. Event Adaptor Type: mqtt 

  6. Broker Url: tcp://localhost:1883 

  7. Clean Session: true 

  8. Keep Alive: 70000

  9. Click  Add Event Adaptor.

     

...

...

After an adapter is successfully added, click  Edit to change its configuration and redeploy it. This will open a 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 or enable statistics and tracing using the provided UI options.

Anchor
Using a configuration file
Using a configuration file

...

Configure using a configuration file

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

  1. Create a an XML file with the following MQTT input event adaptor adapter configurations.

    Info

     Input event

    adaptor

    adapter implementation must start with <inputEventAdaptor> as the root element.

    Code Block
    languagehtml/xml
    <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 it in the XML file to the <PRODUCT_HOME>/repository/deployment/server/inputeventadaptors/  directory.
     

    Info

    Since hot deployment is enabled, you can simply add/remove files to deploy/undeploy to/from the server.  

Info

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 will be are used in event builders. With input event adaptor message properties, event builders will be are able to extract data from the incoming events to build the event streams. Following are the specific message properties of input MQTT event adapter.

MQTT input event builderImage Added

Property

...

Description
Topic
 :
The topic that will be used to receive messages on
the mqttInputAdaptor
the MQTT input adapter
Client Id
:
Unique client
id
ID used for communication
(
. You cannot have duplicated client IDs for the same MQTT broker.
)
Input Mapping Type
:
The incoming event type to be mapped.