We're bringing simple back (to streaming)

Ashley Jeffs shares the view of Redpanda and Benthos.

February 24, 2021
Last modified on
TL;DR Takeaways:
How can I combine the functionalities of Redpanda and Benthos?

You can combine Redpanda and Benthos by running them with Docker. First, pull both images and create a new network for the services to connect with. Then, run Redpanda in the background and create a config to send data to Redpanda with Benthos. You can use Benthos itself to generate a config like this. Finally, run Benthos by adding the config as a Docker volume.

What is Benthos and how can it be used in stream processing?

Benthos is an open source stream processor that offers data mapping, filtering, hydration, and enrichment capabilities across a wide range of connectors. It operates on a minimal, declarative configuration spec and a transaction-based architecture, which eliminates the need for developing resilient stream processing pipelines. You can find full instructions for getting started with Benthos here.

What is Redpanda and how does it simplify data persistence and availability?

Redpanda is a Kafka-compatible streaming platform that simplifies the operational effort of data persistence and availability due to its simplicity and high performance. It eliminates the need for managing moving parts in your streaming architecture. You can learn more about Redpanda and how to get started with it here.

Learn more at Redpanda University

Combining the power of Redpanda and Benthos for your streaming needs is so simple that this blog post is almost over already.

Benthos is an open source stream processor that provides data mapping, filtering, hydration and enrichment capabilities across a wide range of connectors. It is driven by a minimal, declarative configuration spec, and with a transaction based architecture it eliminates the development effort of building resilient stream processing pipelines.

Likewise, with its simplicity and high performance, Redpanda eliminates the operational effort of data persistence and availability by providing a Kafka-compatible streaming platform without the moving parts.

With so much taken care of you're well in for a boring, uneventful time when you combine the two. Make sure you've grabbed a copy of both services, full instructions can be found in the getting started guide for Benthos and the Redpanda docs. In this post we'll be running them with Docker so we'll start by pulling both images:

docker pull vectorized/redpanda:latest
docker pull jeffail/benthos:latest

We can then create a new network for the services to connect with:

docker network create -d bridge redpandanet

Next, run Redpanda in the background, we'll go with a single node for now:

docker run -d \
  --network redpandanet \
  --name redpanda \
  -p 9092:9092 \
  vectorized/redpanda redpanda start \
  --reserve-memory 0M \
  --overprovisioned \
  --smp 1 \
  --memory 1G \
  --advertise-kafka-addr redpanda:9092

In order to send data to Redpanda with Benthos we'll need to create a config, starting off with a simple Stdin to Kafka pipeline, copy the following config into a file producer.yaml:

input:
  stdin: {}

output:
  kafka:
    addresses: [ redpanda:9092 ]
    topic: topic_A

Pro tip: You can also use Benthos itself to generate a config like this with docker run --rm jeffail/benthos create stdin//kafka > ./producer.yaml.

And now run Benthos by adding the config as a Docker volume, along with a pseudo-TTY for writing our messages:

docker run --rm -it \
  --network redpandanet \
  -v $(pwd)/producer.yaml:/benthos.yaml \
  jeffail/benthos

This will open an interactive shell where you can write in some data to send. Benthos will gobble up anything you throw at it, try mixing structured and unstructured messages, ending each message with a newline:

{"id":"1","data":"a structured message"}
but this here ain't structured at all!
[{"id":"2"},"also structured in a different (but totally valid) way"]

When you're finished hit CTRL+C and it'll exit.

Next, let's try reading that data back out from Redpanda, this time let's also add a processor in order to mutate our data, copy the following into a file consumer.yaml:

input:
  kafka:
    addresses: [ redpanda:9092 ]
    topics: [ topic_A ]
    consumer_group: example_group

pipeline:
  processors:
    - bloblang: |
        root.doc = this | content().string()
        root.length = content().length()
        root.topic = meta("kafka_topic")

output:
  stdout: {}

And run it with our new config, and without the pseudo-TTY this time:

docker run --rm \
  --network redpandanet \
  -v $(pwd)/consumer.yaml:/benthos.yaml \
  jeffail/benthos

Now you should see it print mutated versions of the messages you sent to Stdout:

{"doc":{"data":"a structured message","id":"1"},"length":40,"topic":"topic_A"}
{"doc":"but this here ain't structured at all!","length":38,"topic":"topic_A"}
{"doc":[{"id":"2"},"also structured in a different (but totally valid) way"],"length":69,"topic":"topic_A"}

The Bloblang processor in our consumer config has remapped the original message to a new field doc, first attempting to extract it as a structured document, but falling back to a stringified version of it when it's unstructured. We've also added a field length which contains the length of the original message, and topic which contains the Kafka topic the message was consumed from.

That's it for now, if you're still hungry for more then check out the Benthos website at https://www.benthos.dev, and you can learn more about the Benthos mapping language Bloblang in this guide.

Redpanda Slack Community.

No items found.

Related articles

View all posts
Towfiqa Yasmeen
,
Mike Broberg
,
&
Feb 3, 2026

Redpanda Serverless now Generally Available

Zero-ops simplicity meets enterprise-grade security to unlock production-ready data streaming for builders

Read more
Text Link
Jake Cahill
,
,
&
Jan 29, 2026

Bloblang playground just got smarter

Smarter autocomplete, dynamic metadata detection, and swifter collaboration

Read more
Text Link
Peter Henn
,
,
&
Jan 6, 2026

Build a real-time lakehouse architecture with Redpanda and Databricks

One architecture for real-time and analytics workloads. Easy to access, governed, and immediately queryable

Read more
Text Link
PANDA MAIL

Stay in the loop

Subscribe to our VIP (very important panda) mailing list to pounce on the latest blogs, surprise announcements, and community events!
Opt out anytime.