# Configure batching for Aerospike Connect for Elasticsearch

Aerospike Connect for Elasticsearch uses the batching feature of Elasticsearch’s [Bulk API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk) to collect a group of change notifications into a single batch.

## Configuration options

A group of Change Notification Records are collected into a batch until any one of `max-bytes`, `max-records`, or `batch-interval` is exceeded.

| Option | Required | Default | Description | Details |
| --- | --- | --- | --- | --- |
| max-bytes | No | 9223372036854775807 | A positive integer value that defines the maximum size of a batch in bytes. | This is not the hard limit; the actual size of a batch can be higher than this setting. Batch size is checked before adding a record to the batch. |
| max-records | No | 2147483647 | A positive integer value that defines the maximum number of records a batch can contain. |  |
| batch-interval | No | 8000 | A positive integer value that defines the amount of time in milliseconds to wait before sending a batch of records to the destination. | When setting this time, keep in mind that other events happen after this stage, such as a custom transformer and dispatch to the destination site. Leave time for these events to occur. XDR’s non-configurable timeout is 10 seconds. |
| enabled | No | true | Whether or not batching is enabled. | You can enable batching at one level but disable it at another. For example, you can enable batching at the namespace level, but disable it for other levels. |

## Example

```yaml
...

# The default batching configuration to use unless overridden at namespace or set level.

batching:

  batch-interval: 5000

  max-bytes: 2000000

  max-records: 25

namespaces:

  ...

  players:

    ...

    batching:

      batch-interval: 2000

    sets:

      ...

      retired:

        batching:

          enabled: false # Disable batching for the set "retired" in namespace "players".

      ...

    ...

  ...

...
```