This is a Nifi processor which functions similar to the Linksmart Gateway. A user can specify a sub-process to run under this processor. This processor will catch the
stdout of that sub-process and propagate the information into the Nifi system. This processor has the following properties:
|Command Line||The command line to be executed in a subprocess.|
|Maximum Message Queue Size||The maximum number of messages to add to a single FlowFile. If multiple messages are available, they will be concatenated along with the up to this configured maximum number of messages.|
|Maximum Batch Size||The maximum number of messages to add to a single FlowFile. If multiple messages are available, they will be concatenated along with the up to this configured maximum number of messages.|
|Batching Message Delimiter||Specifies the delimiter to place between messages when multiple messages are bundled together (see property).|
Example for Sub-process
In principle, as long as a sub-process writes data to its
stdout channel, it could be used with the
LinkSmartGateway. Typically, a user can specify a script, e.g. a Python script, to be run as a sub-process. In that script, some sensor data will be read and published to the
stdout channel. In practice, the sub-process should follow the following principles:
- The sub-process should be a long running program.
- The sub-process should publish useful information to
stdoutand error messages to
stderr, so that the error messages could also be propagated to Nifi interface.
- The sub-process should catch the
SIGTERMsignal, because this is the signal the
LinksmartProcessorsend to the sub-process, when it tries to terminate it. The sub-process should have a callback function which shuts itself down gracefully (closing opened resources/connections, etc.).
- The sub-process should print each outgoing message with a new line symbol at the end (
\r\n), as this symbol is used by the processor to separate messages.
As an example, this is a Python script which fits the above principles:
Let's assume the above script is saved as
/scripts/dummy.py in the same host as the running Nifi instance. Then in the
Command Line property of the
LinksmartProcessor, you can fill in
python /scripts/dummy.py. Run the processor, and the message will be published by the
This processor is responsible for registering a service entry to the Linksmart Service Catalog. It has the following parameters:
|Service Catalog URL||The URL of the Linksmart Service Catalog.|
|Service ID||The ID of this service, which will be used for identification in the Linksmart Service Catalog. If left empty, a random UUID will be assigned automatically by the Service Catalog|
|Service Entry Body||The content to be sent to the Service Catalog|
Once scheduled, this processor will take care of registering a service entry in the Linksmart Service Catalog. Once it is stopped, it will delete the service entry in the catalog. Once scheduled, this processor will take care of registering a service entry in the Linksmart Service Catalog. Once it is stopped, it will delete the service entry in the catalog.