Bins in Aerospike records correspond to the names of attributes in messages generated by the connector. For cases where the name of a bin does not match the name of the corresponding attribute, you can use the
bin-transforms section of the
/etc/aerospike-pubsub-outbound/aerospike-pubsub-outbound.yml YAML file to configure the transformations to apply on the names of bins.
The transforms can be specified as a mapping or a series of transforms to apply on the bin names. In case a bin name is specified in the mapping section then the transforms are not applied on the matched bin.
map option lets you specify the name of one or more bins and the name of their corresponding attributes in published messages. For example, suppose that your Aerospike records contained these bins and messages include these attributes:
The entries for the
map option in the
bin-transforms section of your configuration file would look like this:
If your Aerospike records include bins whose names do not match attribute names and that are not listed as entries for the
map option, then you must use the
transforms option to specify how to map bin names to attribute names.
The following transforms are supported:
lowercaseConverts to lowercase.
uppercaseConverts to uppercase
trimTrims leading and trailing whitespace.
regexMatches against a regex pattern and replaces all occurrences with a replacement. The regex and replacement use Java regex syntax.
This example shows a mapping of the bin name
red-color to the attribute name
red. It also shows transforms to apply to all other bin names.
If an Aerospike record includes the bins
blue-color, the corresponding attributes in the published message will have the names
BLUE_COLOR, as shown in the table below:
|Aerospike Bin Name||Transformed name|