Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Apache Pulsar

ChirpStack Pulsar integration publishes integration events to an Apache Pulsar instance. It reads integration events by directly subscribing to the Redis event stream.

Note: this integration must be installed as an additional component.

Installation

Binaries

Setup software repository

ChirpStack provides a Debian / Ubuntu repository which can be used to install the latest ChirpStack version. First make sure that gpg is installed:

sudo apt install gpg

Set up the key for the ChirpStack repository:

sudo mkdir -p /etc/apt/keyrings/
sudo sh -c 'wget -q -O - https://artifacts.chirpstack.io/packages/chirpstack.key | gpg --dearmor > /etc/apt/keyrings/chirpstack.gpg'

Add the repository to the repository list:

echo "deb [signed-by=/etc/apt/keyrings/chirpstack.gpg] https://artifacts.chirpstack.io/packages/4.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack.list

Update the apt package cache:

sudo apt update

Docker

For Docker images, please refer to https://hub.docker.com/r/chirpstack/chirpstack-pulsar-integration

Configuration

ChirpStack Pulsar Integration

To list all CLI options, start chirpstack-pulsar-integration with the --help flag. This will print:

Apache Pulsar integration for ChirpStack

Usage: chirpstack-pulsar-integration --config <FILE>

Options:
  -c, --config <FILE>  
  -h, --help           Print help
  -V, --version        Print version

Example configuration file:

[logging]
  # Log level.
  level="info"

[redis]
  # Server address or addresses.
  #
  # Use rediss:// in case of a TLS secured connection.
  #
  # Example formats:
  #   redis://127.0.0.1:6379
  #   rediss://127.0.0.1:6379
  #   redis://:password@127.0.0.1:6379
  #   redis://username:password@127.0.0.1:6379
  #
  # Set multiple addresses when connecting to a cluster.
  servers=[
    "redis://127.0.0.1/",
  ]

  # Redis Cluster.
  #
  # Set this to true when the provided URLs are pointing to a Redis Cluster
  # instance.
  cluster=false

  # Key prefix.
  #
  # A key prefix can be used to avoid key collisions when multiple deployments
  # are using the same Redis database and it is not possible to separate
  # keys by database index (e.g. when using Redis Cluster, which does not
  # support multiple databases).
  key_prefix=""

  # Consumer and consumer group name.
  #
  # This integration reads the events directly from the Redis event stream.
  #
  # If you are running multiple instances of this integration and you would
  # like to avoid receiving duplicated events, then all instances must share
  # the same consumer-group, each with an unique consumer name. For more
  # information about Redis Streams, see:
  # https://redis.io/docs/data-types/streams/#consumer-groups
  consumer_group="integration_pulsar"

  # Consumer name.
  consumer_name="main"

[pulsar]
  # Pulsar server URL.
  server="pulsar://127.0.0.1:6650"

  # Event topic.
  event_topic="application.{{application_id}}.device.{{dev_eui}}.event.{{event}}"

  # Authentication token (JWT).
  auth_token=""

  # Publish events as JSON instead of Protobuf (binary).
  json=true

ChirpStack configuration

The Redis Stream storing the integration events retains a limited amount of payloads. This number can be configured by setting the device_event_log_max_history option in the ChirpStack Configuration.

Source

Please refer to https://github.com/chirpstack/chirpstack-pulsar-integration/ for source-code.