Download the PHP package kafka-bus/metadata without Composer
On this page you can find all versions of the php package kafka-bus/metadata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kafka-bus/metadata
More information about kafka-bus/metadata
Files in kafka-bus/metadata
Package metadata
Short Description Inspect Apache Kafka topics, partitions and consumer group offsets from PHP and administer committed offsets
License MIT
Homepage https://github.com/kafka-bus/metadata
Informations about the package metadata
Kafka Bus Metadata
Inspect Apache Kafka topics, partitions, watermarks and committed consumer group offsets from PHP. Update offsets for selected topics and partitions with bounds validation.
Installation
Requires PHP 8.2+ and ext-rdkafka. Composer installs Kafka Bus Core.
Quick start: inspect a topic
With Kafka at localhost:9092 and an existing orders.events topic, save this next to vendor/ and run it with PHP:
$metadata->topics()->list() lists cluster topics. Pass a list of Core Topic objects to filter it.
Inspect group offsets
Continue from the example above:
The high watermark is the next offset after the last available record. A group without a committed offset may return a Kafka invalid-offset sentinel. A missing topic is represented in Partitions::list() by a placeholder with partition ID -1.
Change committed offsets
Perform offset administration while the affected consumers are stopped, so they do not overwrite the new offsets. This changes where that group resumes reading:
RD_KAFKA_PARTITION_UA selects every partition. Use a concrete partition ID for one partition. Offset::Early selects its low watermark, Offset::Latest its high watermark; an integer selects an explicit offset. Requests outside the available bounds raise CannotCommitOffsetException.
Each result contains the topic, partition, old offset and new offset. For lower-level access, $metadata->consumerGroup($config) exposes partitions($topicName) and commit($partitionOffsets).