The data received by your device sensors will be sent to WSO2 Data Analytic Server (DAS) so that you can view them in real-time or as historical data. Before sending data to WSO2 DAS, you will want to encode it or convert it to a preferred format. How can you do this?
WSO2 IoT Server provides you with the ability to transform and validate content before sending them to WSO2 DAS. Once this is done you can configure WSO2 IoT Server to send data to subscribed events or send them directly to WSO2 DAS. Take a look at the diagram given below:
Let's take a look at how you can send data to WSO2 DAS:
You can write your own custom logic to transform and validate content before sending your data to WSO2 DAS. To understand how this is done, let's take a look at how the content transformer and validator are used by the analytics receiver of the RaspberryPi device type
The MQTT transport extension is used for this purpose.
Transform the data you receive, such as encoding the data, before sending it to WSO2 DAS.
In the case of the RaspberryPi device type, it uses the default content transformer that sends the data as it is to WSO2 DAS.
If you wish to transform the content, you need to implement the
- Customize the content transformer to match your requirement.
Once the MQTT transport extension/input adapter receives the data sent by the device, you will need to verify if it's a spoofer or if it's the device user that is sending the data. After this fact is verified you can configure WSO2 IoT Server to send the content to WSO2 DAS.
In the RaspberryPi device type, the API path that is used to send the data is verified by checking if the device ID in it matches the ID of the device registered with WSO2 IoT Server. You can validate the content using the MQTT, HTTP, and XMPP content validators.
Configuring the Analytic Receiver by adding the following configurations.
Why configure the receiver?
Once you have configured WSO2 IoT Server to transform and validate content, you need to direct the receiver that receives these data to the correct classpaths so as to transform and validate the content accordingly. This needs to be configured in the respective
Super Tenant configurations
Click here for more information.
Want to configure the analytics receiver for your tenant without using the super tenant configurations? Follow the steps given below:Click here for more information.
Optionally, if you want to configure the Analytic Receiver after deploying the artifacts, follow the steps given below:
Navigate to the analytics console:
The default IoT Server host is
localhostand the default analytics port on IoT Server is
- Click Receivers that is on the Main tab, and click on the event publisher your want to configure.
Click Edit and edit the details of the receiver.
Event Receiver Name
This is the unique name of your event receiver. The name is similar to what you have defined in your
Input-Event Adapter Type
An input event adapter (transport) configuration via which the event receiver receives events.
You can define the content transformer and validator properties only if you select
The name of the topic that the receiver needs to subscribe to.
This is similar to what's defined in the
Type of the content Validation or 'default' to set default type, required to implement (if required)
Type of the content transformer or 'default' to set default type, required to implement (if required)
- Click Update.