PubNub
The PubNub Functions allow you to collect and send data to/from the PubNub platform.
This allows the stream to communicate using the messaging API in real time. The data allows for the stream to be processed and leveraged onto various IoT devices, wide-scale infrastructure that can be utilized in a variety of scenarios and solutions.
To use these Functions, you first need to create a PubNub account. For information on how to do this, see https://www.pubnub.com/docs.
To configure the PubNub Functions, the following is required from your PubNub account:
Fields | Description |
---|---|
Subscribe Key | The key used to subscribe to a channel that is available on the Keys page in your PubNub account. |
Channel | The name of the channel you are subscribing to or publishing to |
Publish Key | The key used to publish a message to a channel that is available on the Keys page in your PubNub account. |
Message | The message that you want to publish |
UUID | The universally unique identifier of the client publishing the message. |
There are two types of PubNub Functions available in Usage Engine:
- PubNub collector
- PubNub forwarder
PubNub Collector
The collector enables you to subscribe to a channel and read messages in that channel using PubNub.
To configure the PubNub collector, you must specify the Subscribe Key and the name of the Channel(s) that you want to subscribe to, in the Subscribe Settings. You can subscribe to one channel or more.
PubNub Forwarder
The forwarder enables you to subscribe to a channel and send messages to that channel using PubNub.
To configure the PubNub forwarder take the following steps:
In Subscribe Settings, specify the Subscribe Key and the Channel where you want to publish your messages.
In Publish Settings, specify the Publish Key, Message and UUID.
If you do not specify a UUID, the system automatically generates a UUID when the message is published to the channel.
- To store messages in the channel even when you are not logged in, you can select an option in Store record history. The default option is set to No. If you choose to store the recorded history by selecting Yes, you must select the time period for which you want to store the message(s) in Record expiry options.
Record expiry options | Description |
---|---|
Default channel setting | The default storage setting is configured in the PubNub account. |
Forever | Store messages forever |
Custom period | Select a custom storage period. The available options are:
Note! The default option for Custom period is set to 1 Day. |