/
PubNub

PubNub

With the PubNub functions you can collect and send data to/from the PubNub platform.

This allows the stream to communicate using the messaging API in real-time. The data can be processed by the stream and leveraged onto various IoT devices, a wide-scale infrastructure that can be used in various scenarios and solutions. 

To use these functions, you 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

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:

  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

Note!

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

  1. 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 options

Description

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:

  • 1 Day

  • 1 Week 

  • 1 Hour

  • 1 Month

Note!

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