Loading
Configure Namespaces for Aerospike Connect for Elasticsearch
The namespaces
section of the aerospike-elasticsearch-outbound.yaml
file overrides settings for bin-name transformations, routing modes, and serialization formats.
Option | Required | Description |
---|---|---|
bin-transforms | no | Bin transforms for the namespace. |
routing | no | Routing for the namespace. |
format | no | Format for the namespace. |
sets | no | Map of set name to bin-transform, routing and format configuration. |
The order of preference for picking the configuration for the bin-transforms, routing and format for a given record are:
- set, if configured
- namespace, if configured
- default
caution
- If the route or format are not specified for a record, the record is skipped.
- Set name is not shipped for a delete, which means set-specific routing can never be applied to a delete. In this case, the writes are routed according to set configuration, but the deletes are routed according to the namespace configuration. This can result in unintentionally routing writes and deletes to different destinations.
Example
This example implements the following rules:
Namespace | Set | Routing | Format | Bin Transforms | Action |
---|---|---|---|---|---|
users | custom | Write record in custom format. | |||
users | premium | custom (with flat-json payload) | uppercase | Convert all bin names to upper case and format them in custom format where a custom formatter receives flat-json payload. | |
users | blackList | skip | Skip sending data of blackList set to Elasticsearch. | ||
places | Skip record, since routing or format information is missing. |
...
format:
mode: custom
batch-formatter-class: com.aerospike.connect.outbound.transformer.examples.elasticsearch.ElasticsearchCustomJsonBatchFormatter
namespaces:
users:
sets:
blackList:
routing:
mode: skip
premium:
format:
mode: custom
batch-formatter-class: com.aerospike.connect.outbound.transformer.examples.elasticsearch.ElasticsearchCustomFlatJsonBatchFormatter
payload-format:
mode: flat-json
bin-transforms:
transforms:
- uppercase
...