StreamName¶
This formatter prefixes data with the name of the current or previous stream.
Parameters¶
UsePrevious
Set to true to use the name of the previous stream. By default this parameter is set to false.
Separator (default: :)
Defines the separator string used between stream name and data. By default this parameter is set to “:”.
Parameters (from core.SimpleFormatter)¶
ApplyTo
This value chooses the part of the message the formatting should be applied to. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.
SkipIfEmpty
When set to true, this formatter will not be applied to data that is empty or - in case of metadata - not existing. By default this parameter is set to false
Examples¶
This example prefixes the message with the most recent routing history.
exampleProducer:
Type: producer.Console
Streams: "*"
Modulators:
- format.StreamName:
Separator: ", "
UsePrevious: true
- format.StreamName:
Separator: ": "