Time Channel Adapter

The time adapter generates periodic ticks and injects them as messages into the flow. It is useful for scheduled pipelines, external resource polling, and timer-based workflows.

Availability

Included in default-channel-adapters, transitively available with pipelite-core.

Usage

Pipelite.defineFlow("scheduled-flow")
    .fromSource("time://ticker?period=5000")   (1)
    .process("check", exchange -> {
        // logic executed every 5 seconds
    })
    .toSink("slf4j://log")
    .build();
1 Generates a tick every 5000 ms.

URL format

time://<name>[?period=<ms>]
Parameter Default Description

name

(required)

Logical name of the timer (e.g. ticker, heartbeat)

period

1000

Tick period in milliseconds

Internal mechanism

The TimePollingConsumer uses a ScheduledExecutorService via TimeService. On each tick, a new Exchange is created with a payload containing the current timestamp. The consumer is started and stopped together with the PipeliteContext.