---
title: "Broadcast"
description: "Reliable message relaying service for app server clusters with local and Redis broadcast options. (Gitana 4.0)"
product: "Gitana"
version: "4.0"
url: "/documentation/gitana/4.0/developers/app-server/services/broadcast"
---

# Broadcast

The Broadcast service is responsible for relaying messages to members of the application server cluster. It provides an essential publish and subscription service so that application server members can broadcast messages, receive messages and subscribe to topics and events that occur throughout the system.

## Essential Configuration

```
{
    "broadcast": {
        "enabled": <boolean>,
        "type": "<type>",
        "config": {
            ...configuration
        }
    }
}
```

There are two types of broadcast providers:

- `local` - works for the `single` mode within a single machine
- `redis` - uses Redis to broadcast messages across a `cluster`

For more information about setup modes, please see [Application Server Clustering](/documentation/gitana/4.0/developers/app-server/clustering.md).

## Local Provider

No configuration is required for this provider.

Example:

```
{
    "setup": "single",
    "broadcast": {
        "enabled": true,
        "type": "local"
    }
}
```

## Redis Provider

```
{
    "setup": "cluster",
    "broadcast": {
        "enabled": true,
        "type": "redis",
        "config": {
            "endpoint": "<Redis endpoint URL>",
            "port": <Redis port>
        }
    }
}
```

## Environment Variables

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

- `CLOUDCMS_BROADCAST_TYPE` - either `local` or `redis`

You can configure the Broadcast Redis Provider using the following settings:

- `CLOUDCMS_BROADCAST_REDIS_DEBUG_LEVEL` - either `info`, `warn`, `error` or `debug`
- `CLOUDCMS_BROADCAST_REDIS_ENDPOINT` - the `host`
- `CLOUDCMS_BROADCAST_REDIS_PORT` - the `port`

Further, the Broadcast Redis Provider will automatically draw from the following global Redis environment variables if you've set them:

- `CLOUDCMS_REDIS_DEBUG_LEVEL` - either `info`, `warn`, `error` or `debug`
- `CLOUDCMS_REDIS_ENDPOINT` - the `host`
- `CLOUDCMS_REDIS_PORT` - the `port`
