Random

The “Random” router relays each message sent to the stream [Stream] to exactly one of the producers connected to [Stream]. The receiving producer is chosen randomly for each message.

Parameters

Enable (default: true)

Switches this plugin on or off.

Parameters (from core.SimpleRouter)

Stream

This value specifies the name of the stream this plugin is supposed to read messages from.

Filters

This value defines an optional list of Filter plugins to connect to this router.

TimeoutMs (default: 0, unit: ms)

This value sets a timeout in milliseconds until a message should handled by the router. You can disable this behavior by setting it to “0”. By default this parameter is set to “0”.

Examples

This example will randomly send messages to one of the two console producers.

randomRouter:
  Type: router.Random
  Stream: randomStream
JunkPrinter00:
  Type: producer.Console
  Streams: randomStream
  Modulators:
    - format.Envelope:
        Prefix: "[junk_00] "
JunkPrinter01:
  Type: producer.Console
  Streams: randomStream
  Modulators:
    - format.Envelope:
        Prefix: "[junk_01] "