External Nodes used are used to interact with external systems.
Node publish messages to AWS SNS (Amazon Simple Notification Service).
Configuration:
In the following example, topic name depends on Device Type and there is a Message that contains deviceType field in Metadata:
1 2 3 { deviceType: controller }
For publishing message in controller’s topic, we will set this pattern in Topic ARN pattern:
arn:aws:sns:us-east-1:123456789012:${deviceType}
In runtime, pattern will be resolved to arn:aws:sns:us-east-1:123456789012:controller
arn:aws:sns:us-east-1:123456789012:controller
Published payload – Node will publish full Message payload to the SNS. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload to the SNS.
Outbound message from this node will contain response messageId and requestId in Message metadata. Original Message payload, type and originator will not be changed.
Node publish messages to the AWS SQS (Amazon Simple Queue Service).
${deviceType}
In the following example, Queue URL depends on Device Type and there is a Message that contains deviceType field in Metadata:
For publishing message in controller’s Queue, we will set this pattern in Queue URL pattern:
https://sqs.us-east-1.amazonaws.com/123456789012/${deviceType}
In runtime, pattern will be resolved to https://sqs.us-east-1.amazonaws.com/123456789012/controller
https://sqs.us-east-1.amazonaws.com/123456789012/controller
Published body – Node will publish full Message payload to the SQS. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload to the SQS.
Published attributes – optional list of attributes can be added for publishing message in SQS. It is a collection of – pairs. Both, NAME and VALUE, could be a static values or patterns that will be resolved using Message metadata.
If FIFO queue is selected, then Message ID will be used as deduplication ID and Message originator as group ID.
Outbound message from this node will contain response messageId, requestId, messageBodyMd5, messageAttributesMd5 and sequenceNumber in Message metadata. Original Message payload, type and originator will not be changed.
Kafka Node sends messages to Kafka brokers. Expects messages with any message type. Will send record via Kafka producer to Kafka server.
Published body – Node will send full Message payload to the Kafka topic. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload to the Kafka.
Outbound message from this node will contain response offset, partition and topic properties in the Message metadata. Original Message payload, type and originator will not be changed.
Note – if you want to use Confluent cloud as a kafka broker you should add next properties:
Publish incoming message payload to the topic of the configured MQTT broker with QoS AT_LEAST_ONCE.
Different Authentication credentials are supported for external MQTT broker:
If PEM credentials type is selected, the following configuration should be provided:
Published body – Node will send full Message payload to the MQTT topic. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload to the MQTT broker.
In case of successful message publishing, original Message will be passed to the next nodes via Success chain, otherwise Failure chain is used.
Different Authentication credentials are supported for Azure IoT Hub:
If Shared Access Signature credentials type is selected, the following configuration should be provided:
X.509 CA-signed authentication
CACertificates instruction
Published body – Node will send full Message payload to the Azure IoT Hub device. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload to the Azure IoT Hub.
Publish incoming message payload to the RabbitMQ.
Published body – Node will send full Message payload to the RabbitMQ. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload.
Invoke REST API calls to the external REST server.
Endpoint URL
URL can be a static string or a pattern. Only Message metadata is used for resolving patterns. So property names that are used in the patterns must exist in the Message Metadata, otherwise raw pattern will be added into URL.
For example, if Message payload contains property deviceType with value container, then this pattern:
http://localhost/api/${deviceType}/update
will be resolved to
http://localhost/api/container/update
Headers
Collection of header name/value can be configured. Those headers will be added into Rest request. Pattern should be used for configured both header name and header value. For example ${deviceType}. Only Message metadata is used for resolving patterns. So property names that are used in the pattern must exist in the Message Metadata, otherwise raw pattern will be added into header.
Request body – Node will send full Message payload to the configured REST endpoint. If required, Rule Chain can be configured to use chain of Transformation Nodes for sending correct Payload.
Outbound message from this node will contain response status, statusCode, statusReason and responce headers in the Message metadata. Outbound Message payload will be the same as response body. Original Message type and originator will not be changed.
To send a single file as request body, add a field attachments to the message metadata with file uuid stored in DataBase. In that case any message data will be ignored and only file content will be sent. To define a request content type use the header setting like
Content-Type: application/json; charset=UTF-8
Here an example of message metadata to send a single file:
1 2 3 { "attachments": "e18b6950-dfca-11eb-affb-8db134b46d68" }
NOTE: This is part of File Storage feature supported by ThingsBoard Professional Edition.
In case of successful request, outbound message will be passed to the next nodes via Success chain, otherwise Failure chain is used.
Node sends incoming message using configured Mail Server. This Node works only with messages that where created using To Email transformation Node, please connect this Node with To Email Node using Success chain.
This Node can work with default Mail Server configured on System level. Please find more details about how to configure default System SMTP Settings.
If specific Mail Server is required for this node – disable Use system SMTP settings checkbox and configure Mail Server manually.
Additionally this node can create email attachments if incoming message has prepared attachments metadata field with reference to files stored in DataBase.
Multiple attachments supported. Use a comma separated no whitespace references (uuids) to send many files. Here an example of message metadata:
1 2 3 { "attachments": "e18b6950-dfca-11eb-affb-8db134b46d68,17383b4c-6000-4bb8-be04-b1cb15aa18c5" }
In case of successful mail sending, original Message will be passed to the next nodes via Success chain, otherwise Failure chain is used.
You can see the real life example, where this node is used, in the next tutorial:
Node is able to construct SMS message based on the metadata fields from the incoming message and send it using AWS SNS or Twilio SMS providers. We recommend enabling debug mode for the rule node.
This Node can work with default SMS provider configured on System level. If SMS message will be sent to all recipients successfully, original Message will be passed to the next nodes via Success chain, otherwise Failure chain is used.
Professional Rule Node
Only Professional Edition supports Twilio SMS Rule Node.Use ThingsBoard Cloud or install your own platform instance.
Sends incoming message payload as SMS message via Twilio service.
SMS message will be sent to all recipients taken from Phone Numbers To list.
If SMS message will be sent to all recipients successfully, original Message will be passed to the next nodes via Success chain, otherwise Failure chain is used.