You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

Module summary

Receiver receives data from IoT devices (HTTP POST, MQTT server, Websockets server), eventually subscribes the data published by 3rd party (MQTT subscribe, Websockets subscribe). It provides authentication and message verification mechanims to ensure the data security and integrity.

There are several modes, in which the Receiver can operate (Endpoint types):

  • MQTT server  - module is running as MQTT broker, which allows devices to either subscribe or publish messages to it
  • MQTT consumer - module subscribes to existing MQTT broker and receives messages from it
  • HTTP POST consumer - module accepts HTTP POST request with data from devices
  • UDP server module accepts UDP datagrams with data from devices
  • Telnet server/client - module is running as telnet server or telnet client
  • Websockets server/client - module is running as Websockets server or client
  • Custom - module is using custom implementation

See Receiver configuration to learn more about all configuration options.

Module lifecycle

Independent on the way how the data are received by the module, once the message is on the Receiver side, following process is applied:

  1. Message is received by the Receiver
  2. Authentication flow is performed
  3. Message format is determined (XML, JSON, bytes, ...)
  4. Message is transformed into normalized internal format
  5. Message rules are checked
    1. If passes message rules check, message is stored in internal memory and value is propagated to Audit module (as last received message)
    2. if not passed, message is rejected/ignored

Authentication

Clients can be authenticated using following methods:

  • basic/digest - username/password based authentication
  • client SSL certificate - client provides the SSL certificate in order to authenticate itself
  • source IP - only requests from particular IP addresses are allowed

Message rules

Each message collected by the receiver is processed by the receiver's message processor, which evaluates message content rules defined in configuration (see receivers[].messageRules). There are 3 types of message rules:

  • Content constraint - module checks, whether the message contains specific content
  • Structure constraint - module checks, whether the message contains specific structure
  • Device ID filter - module checks, whether the device ID is on whitelist or not

Messages are rejected, if they don't pass message rules. Otherwise Receiver stores them in it's internal storage.

Roles

 This module supports following roles:

ModuleRolePermitted operations
ReceiverSENSORAllows to send data to collector (HTTP POST, MQTT_PUBLISH, ...)
ReceiverVIEWERGET /status, GET /data
ReceiverEDITORGET /data, GET/status, DELETE /data

 

Module states

This module can have one of following statuses:

VerticleStatusDescription
ReceiverUPModule is up and running. It operates without any specific limitations.
PAUSEDModule is paused and not receiving any data. Request to "GET /" ends with response code 405.

 

API endpoints

This module provides following HTTP endpoints: 

PathMethodDescriptionURL ParametersExample
/GETReturns plain text with ECHO message (should be used in load balancer to detect UP/DOWN status) https://localhost:8001/
/statusGETReturns JSON object that contains internal state of audit verticle (e.g. total count of sensors) https://localhost:8001/status
/configPOSTSets the configuration to the module. ADMIN role is required.
  • POST body content = config in JSON format
https://localhost:8001/config
/reloadPOSTForces reloading configuration of module. ADMIN role is required.
  • name = module_name
https://localhost:8001/reload
/dataGETReturns JSON array that contains data stored in receiver's internal memory
  • order = "ASC" / "DESC" (default: "ASC")
  • start = from timestamp (default: 0)
  • stop = to timestamp
  • receiver_id = receiver identification
  • sensor_id = sensor identification
  • limit = page size (default: 100)
https://localhost:8001/data
/dataDELETEDeletes specified data from receiver's internal memory.
  • order = "ASC" / "DESC" (default: "ASC")
  • start = from timestamp (default: 0)
  • stop = to timestamp
  • receiver_id = receiver identification
  • sensor_id = sensor identification
  • limit = page size (default: 100)
https://localhost:8001/data
/pauseGETSets status PAUSED for receiver verticle immediately. Returns response from "GET /status" endpoint (see above) https://localhost:8001/pause
/resumeGETSets status UP for receiver verticle immediately. Returns response from "GET /status" endpoint (see above) https://localhost:8001/resume
/logoutGETExecutes logout of currently logged in user https://localhost:8001/logout


On this page


  • No labels