If Apache Iggy is useful to you, give it a star on GitHubStar apache/iggy
Apache Iggy
ConnectorsSources

Random Source

Generate random messages into Iggy streams for testing, benchmarking and verifying a connector pipeline.

The random source connector generates random messages and sends them to Iggy streams. This is useful for testing, benchmarking, and verifying that your connector pipeline is working correctly without needing an external data source.

Configuration

Use the broker credentials and runtime setup from the source guide. Save the configuration below in that runtime's connector directory. From the matching 0.9.0/edge repository root, build the plugin:

cargo build --release -p iggy_connector_random_source
type = "source"
key = "random-source"
enabled = true
version = 1
name = "Random Source"
path = "target/release/libiggy_connector_random_source"
verbose = false

[[streams]]
stream = "my-stream"
topic = "my-topic"
schema = "json"
batch_length = 100
linger_time = "100ms"

[plugin_config]
interval = "100ms"
max_count = 1_000_000
messages_range = [1, 10]
payload_size = 256

Plugin config options

OptionTypeDefaultDescription
intervalstring"1s"Delay before each message generation cycle; invalid duration strings fall back to "1s"
max_countusizeunlimitedStop producing after this many messages in total; omit for unlimited
messages_range[u32, u32][10, 50]Min (inclusive) / max (exclusive) messages per batch, capped by the remaining max_count; the lower bound must be smaller
payload_sizeu32100Number of random characters in the text field of each message

Setting max_count = 0 stops production immediately (the connector produces zero messages). To generate messages without a limit, leave the key out.

The connector stages its count for each batch and commits it only after the runtime acknowledges delivery and saves the checkpoint. Restoring that checkpoint enforces max_count across restarts; missing or undecodable state starts the count at zero. After reaching the limit, polling continues but returns no messages or new checkpoint.

A non-increasing messages_range returns a configuration error when message generation is attempted. The SDK logs poll errors and continues polling. Each generated JSON record contains a random UUID id, fixed title = "Hello" and name = "World", and random alphanumeric text. payload_size controls only that text, not the total serialized record size.

Create my-stream and my-topic before starting the runtime, or change the sample to use an existing destination. Configure one destination per source instance.

On this page