Skip to main content

The attributes section of aerospike-pubsub-outbound.yml

Subscribing applications might need only a subset of the attributes that are in the messages that they consume. If you list the attributes in the configuration file, then the subscribing applications can choose which attributes to select when subscribing, rather than deserialize messages and extract only the data that they need.

You can use the attributes section of the /etc/aerospike-pubsub-outbound/aerospike-pubsub-outbound.yml YAML file to list the attributes that are included in messages, and to specify how their values are derived from Aerospike records.

  • attributes Starts the section in which you can list message attributes.
  • mode Valid values are:
    • bin The value in the bin specified with the bin option is used as the value for the attribute.
    • namespace The name of a record's namespace is used for the value of the attribute.
    • set The name of a record's set is used for the value of the attribute.
    • user-key The user-defined key for a record is used for the value of the attribute. User-defined keys must be strings. By default, user-defined keys are not stored with Aerospike records. Your Aerospike client applications must enable the sendKey write policy, if you want to use this option.
    • static The value specified by the value option is used for the value of the attribute.
  • bin If you specified the value bin for the mode option, use this option to specify the name of the bin. The values in the specified bin must be strings.
  • value If you specified the value static for the mode option, use this option to specify the unchanging value for the attribute.

Example

In this example, the attributes in messages generated from Aerospike records are country, region, product, customer_ID, and closed.

attributes:
country:
mode: bin # Only string bin values will be processed.
bin: country # Value is extracted from a bin named "country" of the Aerospike record.
region:
mode: namespace # Value is extracted from the namespace of the Aerospike record.
product:
mode: set # Value is extracted from the set of the Aerospike record.
customer_ID:
mode: user-key # Only string user-key values will be processed.
closed: # Value is fixed at "no".
mode: static
value: no
  • The value of country is extracted from a bin named country, and the value must be a string.
  • The value of region is the name of the namespace in record metadata.
  • The value of product is the name of the set in record metadata.
  • The value of customer_ID is the user-key in records sent to the connector, and the user-key must be a string value.
  • The value of closed is specified as always being no.