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:

FieldsDescription
Subscribe KeyThe 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 KeyThe key used to publish a message to a channel that is available on the Keys page in your PubNub account.
MessageThe message that you want to publish
UUIDThe 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 SettingsYou 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:

  1. In Subscribe Settings, specify the Subscribe Key and the Channel where you want to publish your messages.

  2. In Publish Settings, specify the Publish KeyMessage and UUID

    If you do not specify a UUID, the system automatically generates a UUID when the message is published to the channel.

  3. 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 NoIf 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 optionsDescription
Default channel settingThe default storage setting is configured in the PubNub account.
Forever

Store messages forever

Custom period
Select a custom storage period. The available options are:
    • 1 Day
    • 1 Week 
    • 1 Hour
    • 1 Month

Note!

The default option for Custom period is set to 1 Day.