---
title: "Configure Event Stream Processing outbound connector"
description: "Configure the Aerospike ESP outbound connector and routing via the aerospike-esp-outbound.yml file."
---

# Configure Event Stream Processing outbound connector

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

Configure the ESP outbound connector with the file `aerospike-esp-outbound.yml`.

## Set up Aerospike Database

In your Aerospike database, you must configure Cross-Datacenter Replication (XDR) and enable change notification. You must also configure your ESP cluster to be a “connector” XDR datacenter. The namespace must point to this as an XDR remote datacenter.

See the [change notification configuration parameters and example configuration](https://aerospike.com/docs/connectors/streaming/common/change-notification).

## Modify `aerospike-esp-outbound.yml`

Configure streaming from Aerospike for ESP by modifying the `aerospike-esp-outbound.yml` YAML configuration file.

The location of this file depends on how you plan to deploy, or have already deployed, the ESP outbound connector:

-   If you deploy in Docker, the file can be anywhere in your system as long as you include the path to it in the `docker run` command.
-   If you deploy in Kubernetes, this file is in a directory that also includes the deployment file.
-   if you deploy in a non-containerized environment, this file is located in the root-level directory, `/etc/aerospike-esp-outbound/`.

The configuration file has the following sections:

-   [`service`](https://aerospike.com/docs/connectors/streaming/esp/configure/service) Configures the connector’s listening ports, TLS, and network interface.
-   [`destinations`](https://aerospike.com/docs/connectors/streaming/esp/configure/destinations) Configures HTTP-based destinations where change notifications are sent.
-   [`bin-transforms`](https://aerospike.com/docs/connectors/streaming/esp/configure/bin-transforms) Specifies the bin transformations to apply on the Aerospike record.
-   [`format`](https://aerospike.com/docs/connectors/streaming/esp/configure/format) Specifies the message format to use for the outbound messages sent to the message broker.
-   [`batching`](https://aerospike.com/docs/connectors/streaming/esp/configure/batching) Specifies how to collect a group of Change Notification Records into a single batch of outbound messages sent to the HTTP endpoint.
-   [`record-ordering`](https://aerospike.com/docs/connectors/streaming/esp/configure/record-ordering) Configure ordering of incoming records sent to the outbound destination.
-   [`routing`](https://aerospike.com/docs/connectors/streaming/esp/configure/routing) Configures how incoming record updates and deletes from Aerospike are routed to the message broker.
-   [`namespaces`](https://aerospike.com/docs/connectors/streaming/esp/configure/namespaces) Configures bin transforms, format, routing at namespace and set level.
-   [`logging`](https://aerospike.com/docs/connectors/streaming/esp/configure/logging) Configures the destination and level for the connector logs.
-   [`port-based-config`](https://aerospike.com/docs/connectors/streaming/esp/configure/port-based-config) Allows alternate configurations based on which port received the change notification.
-   `executor-thread-pool-size` Size of the thread pool used to dispatch HTTP requests. The default value is twice the number of available processors.

::: caution
If the route is not specified for an Aerospike record, then the record is skipped and logged at the _warn_ level.
:::

## Cascading configuration values

You can configure the `bin-transforms`, `format`, and `routing` sections to include `default` values, values for each namespace, and values for each set within a namespace. The appropriate values are applied to each Aerospike record.

Here is an annotated example:

```yaml
routing:

  mode: static

  destination: default <1>

‎‎

namespaces:

  users:

    routing:

      mode: static

      destination: users <2>

    format:

      mode: flat-json

      metadata-key: metadata

    sets:

      premium:

        routing:

          mode: static

          destination: premium <3>
```

1.  Specifies that records in all namespaces are shipped to the `default` destination.
2.  Specifies that records in the `users` namespace are shipped to the `users` destination.
3.  Specifies that records in the `premium` set in the `users` namespace are shipped to the `premium` destination.

## Example

A sample version of `aerospike-esp-outbound.yml` is as follows:

```yaml
service:

  port:

    - 8901

    - 9901

  manage:

    port: 8902

logging:

  enable-console-logging: true

# Destinations

destinations:

  xdr-proxy-1:

    urls:

      - http://proxy1.example.com

    max-requests-queued-per-endpoint: 10240

    connection-ttl: 15000

    max-connections-per-endpoint: 100

    call-timeout: 10000

    connect-timeout: 2000

    health-check:

      call-timeout: 10000

    headers:

      authority-header-omit-default-port: true

      send-digest-header: true

      additional-headers:

        custom-header-1: custom-value-1

        custom-header-2: custom-header-2

  xdr-proxy-2:

    urls:

      - http://proxy2.example.com/

port-based-config:

  8901:

    routing:

      mode: static-multi-destination

      destinations: xdr-proxy-1

  9901:

    routing:

      mode: static-multi-destination

      destinations: xdr-proxy-2
```