In Benthos each message has raw contents and metadata, which is a map of key/value pairs representing an arbitrary amount of complementary data.
When an input protocol supports attributes or metadata they will automatically be added to your messages, refer to the respective input documentation for a list of metadata keys. When an output supports attributes or metadata any metadata key/value pairs in a message will be sent (subject to service limits).
Benthos allows you to add and remove metadata using the
bloblang processor. For example, you can do something like this in your pipeline:
Metadata values can be referenced in any field that supports interpolation functions. For example, you can route messages to Kafka topics using interpolation of metadata keys:
Or, for more complex branches it might be best to use the