| Crates.io | pulsar-cat |
| lib.rs | pulsar-cat |
| version | 0.0.1 |
| created_at | 2025-04-29 07:13:36.619792+00 |
| updated_at | 2025-04-29 07:13:36.619792+00 |
| description | A command-line tool for working with Apache Pulsar |
| homepage | https://github.com/yourusername/pulsar-cat |
| repository | https://github.com/yourusername/pulsar-cat |
| max_upload_size | |
| id | 1653244 |
| size | 107,307 |
A versatile command-line tool for Apache Pulsar
Pulsar-Cat is a command-line utility for Apache Pulsar that lets you produce, consume, and inspect topics easily. It's designed to be simple yet powerful, making it ideal for Pulsar administrators, developers, and for debugging Pulsar deployments.
Think of it as a "netcat for Pulsar" - a swiss-army knife for interacting with your Pulsar deployment.
git clone https://github.com/user/pulsar-cat.git
cd pulsar-cat
./build.sh
Pulsar-Cat operates in one of three modes:
produce or P: Producer modeconsume or C: Consumer modelist or L: List mode (metadata)pulsar-cat --broker <BROKER_URL> <COMMAND> [OPTIONS]
The broker URL is always required:
pulsar-cat --broker pulsar://localhost:6650 <COMMAND> [OPTIONS]
Send messages to a topic:
pulsar-cat --broker pulsar://localhost:6650 produce --topic my-topic
message1
message2
message3
Send messages with a specific partition:
pulsar-cat --broker pulsar://localhost:6650 produce --topic my-topic --partition 0
Send messages with keys:
pulsar-cat --broker pulsar://localhost:6650 produce --topic my-topic --key ":"
key1:message1
key2:message2
Enforce keys for all messages:
pulsar-cat --broker pulsar://localhost:6650 produce --topic my-topic --key ":" --enforce-key
Use compression:
pulsar-cat --broker pulsar://localhost:6650 produce --topic my-topic --compression zstd
Read messages from a topic:
pulsar-cat --broker pulsar://localhost:6650 consume --topic my-topic
Format output:
pulsar-cat --broker pulsar://localhost:6650 consume --topic my-topic --format 'Key: %k, Value: %s'
List topics in a namespace:
pulsar-cat --broker pulsar://localhost:6650 list --namespace tenant/namespace
View information about a specific topic:
pulsar-cat --broker pulsar://localhost:6650 list --topic tenant/namespace/topic
Connect to a secured Pulsar cluster:
pulsar-cat --broker pulsar+ssl://localhost:6651 consume --topic my-topic --auth_token "your-token"
When using the --format option in consumer mode, the following placeholders are available:
%t: Topic name%p: Partition%o: Message offset%k: Message key%s: Message payload (string)%S: Message payload size in bytes%h: Message headers%T: Message timestampAvailable compression algorithms:
none: No compression (default)lz4: LZ4 compressionzlib: ZLIB compressionzstd: ZSTD compressionsnappy: Snappy compressionpulsar-cat --broker pulsar://localhost:6650 consume --topic my-topic
pulsar-cat --broker pulsar://localhost:6650 produce --topic my-topic --key ":"
user1:{"name":"Alice","action":"login"}
user2:{"name":"Bob","action":"search"}
pulsar-cat --broker pulsar://localhost:6650 consume --topic my-topic \
--format "Offset: %o, Key: %k, Value: %s, Time: %T"
pulsar-cat --broker pulsar://localhost:6650 list --namespace my-tenant/my-namespace
Pulsar-Cat is licensed under the Apache License 2.0 - see LICENSE file for details.