Configure Event Stream Processing outbound connector
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.
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 runcommand. - 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:
serviceConfigures the connector’s listening ports, TLS, and network interface.destinationsConfigures HTTP-based destinations where change notifications are sent.bin-transformsSpecifies the bin transformations to apply on the Aerospike record.formatSpecifies the message format to use for the outbound messages sent to the message broker.batchingSpecifies how to collect a group of Change Notification Records into a single batch of outbound messages sent to the HTTP endpoint.routingConfigures how incoming record updates and deletes from Aerospike are routed to the message broker.namespacesConfigures bin transforms, format, routing at namespace and set level.loggingConfigures the destination and level for the connector logs.port-based-configAllows alternate configurations based on which port received the change notification.executor-thread-pool-sizeSize of the thread pool used to dispatch HTTP requests. The default value is twice the number of available processors.record-orderingConfigure ordering of incoming records sent to the outbound destination.
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:
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>- Specifies that records in all namespaces are shipped to the
defaultdestination. - Specifies that records in the
usersnamespace are shipped to theusersdestination. - Specifies that records in the
premiumset in theusersnamespace are shipped to thepremiumdestination.
Example
A sample version of aerospike-esp-outbound.yml is as follows:
service: port: - 8901 - 9901 manage: port: 8902
logging: enable-console-logging: true
# Destinationsdestinations: 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