Notifications

The Notifications service is responsible for receiving messages from the outside world. These are frequently transmitted via a message queue or broker and signal the cluster that it should take some action to update its state. This may include things like invalidating caches or re-syncing content.

Essential Configuration

{
    "notifications": {
        "enabled": <boolean>,
        "log": "<boolean>",
        "type": "<type>",
        "configuration": {
            ...configuration
        }
    }
}

Logging

Logging of notification messages is rather verbose and is enabled by default. You can disable logging of non error message:

"log": false

Providers

There are two types of notification providers:

  • sqs - connects to an Amazon SQS queue
  • stomp - connects to a STOMP protocol queue (ActiveMQ, RabbitMQ, etc)

SQS Provider

Connects the notification service to an Amazon SQS queue.

Example:

{
    "notifications": {
        "enabled": false,
        "log": true,
        "type": "sqs",
        "configuration": {
            "queue": "",
            "accessKey": "",
            "secretKey": "",
            "region": ""
        }
    }
}

The following environment variables can be used to configure the SQS provider:

  • CLOUDCMS_NOTIFICATIONS_SQS_QUEUE_URL
  • CLOUDCMS_NOTIFICATIONS_SQS_ACCESS_KEY
  • CLOUDCMS_NOTIFICATIONS_SQS_SECRET_KEY
  • CLOUDCMS_NOTIFICATIONS_SQS_REGION

Stomp Provider

{
    "setup": "cluster",
    "broadcast": {
        "enabled": true,
        "type": "stomp",
        "config": {
            "host": "",
            "port": -1,
            "username": "",
            "password": "",
            "queueUrl": ""
        }
    }
}

The following environment variables can be used to configure the Stomp provider:

  • CLOUDCMS_NOTIFICATIONS_STOMP_HOST
  • CLOUDCMS_NOTIFICATIONS_STOMP_PORT
  • CLOUDCMS_NOTIFICATIONS_STOMP_USERNAME
  • CLOUDCMS_NOTIFICATIONS_STOMP_PASSWORD
  • CLOUDCMS_NOTIFICATIONS_STOMP_QUEUE_URL

Environment Variables

You can also configure the Notifications Service using the following environment variables:

  • CLOUDCMS_NOTIFICATIONS_TYPE - either sqs or stomp