count

Counts messages starting from one, returning true until the counter reaches its target, at which point it will return false and reset the counter.

count:
arg: 100

Each discrete count condition will have its own counter. Parallel processors containing a count condition will therefore count independently. It is, however, possible to share the counter across processor pipelines by defining the count condition as a resource.

Fields

arg

number A number to count towards.

Examples

This condition is useful when paired with the read_until input, as it can be used to cut the input stream off once a certain number of messages have been read:

# Only read 100 messages, and then exit.
input:
read_until:
input:
kafka_balanced:
addresses: [ TODO ]
topics: [ foo, bar ]
consumer_group: foogroup
condition:
not:
count:
arg: 100