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

Debian / Ubuntu repository

ChirpStack provides pre-compiled binaries as Debian (.deb) packages. To activate this repository, execute the following commands:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1CE2AFD36DBCCA00

sudo echo "deb https://artifacts.chirpstack.io/packages/4.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack_4.list
sudo apt update

ChirpStack also provides a repository for test-builds. To activate the test channel use the following commands (notice that stable has changed into testing):

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1CE2AFD36DBCCA00

sudo echo "deb https://artifacts.chirpstack.io/packages/4.x/deb testing main" | sudo tee /etc/apt/sources.list.d/chirpstack_4.list
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.