diff --git a/content/about/_index.md b/content/about/_index.md index 0ee1a9c..699280b 100644 --- a/content/about/_index.md +++ b/content/about/_index.md @@ -8,6 +8,7 @@ draft: false [![Supported Kafka versions: >= 0.9](https://img.shields.io/badge/kafka-%3E%3D%200.9-blue.svg)](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md#broker-version-compatibility) ![Supported PHP versions: 7.x .. 8.x](https://img.shields.io/badge/php-7.x%20..%208.x-blue.svg) [![License: BSD-3](https://img.shields.io/badge/License-BSD--3-green.svg)](https://github.com/php-kafka/php-simple-kafka-client/blob/main/LICENSE) +[![Join the chat at https://gitter.im/php-kafka/php-simple-kafka-client](https://badges.gitter.im/php-kafka/php-simple-kafka-client.svg)](https://gitter.im/php-kafka/php-simple-kafka-client?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) This extension provides ways to interact with Apache Kafka. You can find some examples for producer and consumer [here](https://github.com/php-kafka/php-kafka-examples/tree/main/src/ext-php-simple-kafka-client) diff --git a/content/configuration/dump.md b/content/configuration/dump.md index c3d2d6b..a40fdbc 100644 --- a/content/configuration/dump.md +++ b/content/configuration/dump.md @@ -12,7 +12,7 @@ Dumps the current configuration ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); $conf->dump(); ``` \ No newline at end of file diff --git a/content/configuration/set.md b/content/configuration/set.md index 8664f38..4fd2cdb 100644 --- a/content/configuration/set.md +++ b/content/configuration/set.md @@ -12,6 +12,6 @@ Set a configuration value ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); ``` diff --git a/content/configuration/setDrMsgCb.md b/content/configuration/setDrMsgCb.md index 30124db..ee6197f 100644 --- a/content/configuration/setDrMsgCb.md +++ b/content/configuration/setDrMsgCb.md @@ -14,7 +14,7 @@ the message was succesfully delivered or permanently failed delivery ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->setDrMsgCb( function (Producer $kafka, Message $message) { if (RD_KAFKA_RESP_ERR_NO_ERROR !== $message->err) { diff --git a/content/configuration/setErrorCb.md b/content/configuration/setErrorCb.md index d402075..0d44121 100644 --- a/content/configuration/setErrorCb.md +++ b/content/configuration/setErrorCb.md @@ -13,9 +13,9 @@ that non-critical errors will be retried by `libdrkafka` ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->setErrorCb( - function (Kafka\Kafka $kafka, $errorCode, $reason) { + function (SimpleKafkaClient\Kafka $kafka, $errorCode, $reason) { //do something } ); diff --git a/content/configuration/setLogCb.md b/content/configuration/setLogCb.md index e2b1a03..1e6e60a 100644 --- a/content/configuration/setLogCb.md +++ b/content/configuration/setLogCb.md @@ -12,9 +12,9 @@ Set a log callback You will get events according to the `log_level` setting ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->setLogCb( - function (Kafka\Kafka $kafka, int $level, string $facility, string $message) { + function (SimpleKafkaClient\Kafka $kafka, int $level, string $facility, string $message) { //do something } ); diff --git a/content/configuration/setOffsetCommitCb.md b/content/configuration/setOffsetCommitCb.md index 3286d05..cff5446 100644 --- a/content/configuration/setOffsetCommitCb.md +++ b/content/configuration/setOffsetCommitCb.md @@ -15,9 +15,9 @@ this callback will be called with `err == RD_KAFKA_RESP_ERR__NO_OFFSET` which is not to be considered an error. ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->setOffsetCommitCb( - function (Kafka\Kafka $kafka, int $errorCode, array $topicPartition) { + function (SimpleKafkaClient\Kafka $kafka, int $errorCode, array $topicPartition) { if (RD_KAFKA_RESP_ERR_NO_ERROR === $errorCode) { echo 'Commit was successful'; } else { diff --git a/content/configuration/setRebalanceCb.md b/content/configuration/setRebalanceCb.md index 2bba6c4..89cd1ba 100644 --- a/content/configuration/setRebalanceCb.md +++ b/content/configuration/setRebalanceCb.md @@ -19,9 +19,9 @@ to the application's callback. ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->setRebalanceCb( - function (Kafka\Consumer $kafka, int $errorCode, array $partitions = null) { + function (SimpleKafkaClient\Consumer $kafka, int $errorCode, array $partitions = null) { case RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS: $kafka->assign($partitions); break; diff --git a/content/configuration/setStatsCb.md b/content/configuration/setStatsCb.md index c29e5f3..40770b3 100644 --- a/content/configuration/setStatsCb.md +++ b/content/configuration/setStatsCb.md @@ -12,9 +12,9 @@ Set a statistics callback The statistics callback is triggered every `statistics.interval.ms` (needs to be configured separately). ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->setStatsCb( - function (Kafka\Kafka $kafka, string $json, int $jsonLength) { + function (SimpleKafkaClient\Kafka $kafka, string $json, int $jsonLength) { //do something } ); diff --git a/content/consumer/__construct.md b/content/consumer/__construct.md index 7f35ab3..118cacb 100644 --- a/content/consumer/__construct.md +++ b/content/consumer/__construct.md @@ -10,7 +10,7 @@ public function __construct(Configuration $configuration) {} Get a consumer instance ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); ``` \ No newline at end of file diff --git a/content/consumer/assign.md b/content/consumer/assign.md index 47c2139..bd6fcac 100644 --- a/content/consumer/assign.md +++ b/content/consumer/assign.md @@ -11,13 +11,13 @@ Atomic assignment of partitions to consume. The new `partitions` will replace the existing assignment. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumer->assign( [ - new Kafka\TopicPartition('test-topic', 1, 3000), - new Kafka\TopicPartition('test-topic', 2, 3009) + new SimpleKafkaClient\TopicPartition('test-topic', 1, 3000), + new SimpleKafkaClient\TopicPartition('test-topic', 2, 3009) ] ); ``` \ No newline at end of file diff --git a/content/consumer/close.md b/content/consumer/close.md index e1127de..311ad1f 100644 --- a/content/consumer/close.md +++ b/content/consumer/close.md @@ -12,8 +12,8 @@ the consumer has revoked its assignment, calling the rebalance callback if it is configured, committed offsets to broker, and left the consumer group. The maximum blocking time is roughly limited to session.timeout.ms. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumer->close(); ``` \ No newline at end of file diff --git a/content/consumer/commit.md b/content/consumer/commit.md index f403160..dc53df8 100644 --- a/content/consumer/commit.md +++ b/content/consumer/commit.md @@ -6,7 +6,7 @@ draft: false ## Description ```php /** - * @throws Kafka\Exception + * @throws SimpleKafkaClient\Exception */ public function commit($messageOrOffsets): void {} ``` @@ -14,14 +14,14 @@ Commit offsets synchronously, block until offsets are committed or the commit fails and an exception is thrown. ## Parameter details - If `null` is passed, latest offsets for the current assignment will be committed -- Ìf a `Kafka\Message` is passed, commit offset for a single topic+partition based on the message -- If an array of `Kafka\TopicPartition` is passed, commit offsets for the provided list of partitions +- Ìf a `SimpleKafkaClient\Message` is passed, commit offset for a single topic+partition based on the message +- If an array of `SimpleKafkaClient\TopicPartition` is passed, commit offsets for the provided list of partitions ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $message = $consumer->consume(20000); if (RD_KAFKA_RESP_ERR_NO_ERROR !== $message->err) { diff --git a/content/consumer/commitAsync.md b/content/consumer/commitAsync.md index 646de81..16fe6db 100644 --- a/content/consumer/commitAsync.md +++ b/content/consumer/commitAsync.md @@ -10,14 +10,14 @@ public function commitAsync($messageOrOffsets): void {} Commit offsets asynchronously ## Parameter details - If `null` is passed, latest offsets for the current assignment will be committed -- Ìf a `Kafka\Message` is passed, commit offset for a single topic+partition based on the message -- If an array of `Kafka\TopicPartition` is passed, commit offsets for the provided list of partitions +- Ìf a `SimpleKafkaClient\Message` is passed, commit offset for a single topic+partition based on the message +- If an array of `SimpleKafkaClient\TopicPartition` is passed, commit offsets for the provided list of partitions ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $message = $consumer->consume(20000); if (RD_KAFKA_RESP_ERR_NO_ERROR !== $message->err) { diff --git a/content/consumer/consume.md b/content/consumer/consume.md index 05e7968..8a2b05c 100644 --- a/content/consumer/consume.md +++ b/content/consumer/consume.md @@ -12,9 +12,9 @@ Registered callbacks will be automaically called `rebalanceCallback`, `logCallba On error `$message->err` will not be `RD_KAFKA_ERR_NO_ERROR` but contain the acutal error code. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $message = $consumer->consume(20000); ``` {{< hint info >}} diff --git a/content/consumer/getAssignment.md b/content/consumer/getAssignment.md index de98dda..94d9e8c 100644 --- a/content/consumer/getAssignment.md +++ b/content/consumer/getAssignment.md @@ -10,13 +10,13 @@ public function getAssignment(): array {} Returns the current partition assignment ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumer->assign( [ - new Kafka\TopicPartition('test-topic', 1, 3000), - new Kafka\TopicPartition('test-topic', 2, 3009) + new SimpleKafkaClient\TopicPartition('test-topic', 1, 3000), + new SimpleKafkaClient\TopicPartition('test-topic', 2, 3009) ] ); var_dump($consumer->getAssignment()); diff --git a/content/consumer/getCommittedOffsets.md b/content/consumer/getCommittedOffsets.md index b3cd2f0..cdd75e9 100644 --- a/content/consumer/getCommittedOffsets.md +++ b/content/consumer/getCommittedOffsets.md @@ -10,9 +10,9 @@ public function getCommittedOffsets(array $topics, int $timeoutMs): array {} Returns the committed offsets for topics and partitions for a consumer group ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $topicPartition = new TopicPartition('test-topic', 0); var_dump($consumer->getCommittedOffsets([$topicPartition], 10000)); ``` \ No newline at end of file diff --git a/content/consumer/getMetadata.md b/content/consumer/getMetadata.md index 8cf588c..7599296 100644 --- a/content/consumer/getMetadata.md +++ b/content/consumer/getMetadata.md @@ -10,9 +10,9 @@ function getMetadata(bool $allTopics, int $timeoutMs, ConsumerTopic $topic = nul Get metadata for all topics or a single topic ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $topicHandle = $consumer->getTopicHandle('test-topic'); $singleTopicMetadata = $consumer->metadata(true, $topicHandle, 10000); ``` \ No newline at end of file diff --git a/content/consumer/getOffsetPositions.md b/content/consumer/getOffsetPositions.md index 84e8f50..dca303e 100644 --- a/content/consumer/getOffsetPositions.md +++ b/content/consumer/getOffsetPositions.md @@ -11,9 +11,9 @@ The offset field of each requested partition will be set to the offset of the la If there was no previous message `RD_KAFKA_OFFSET_INVALID` will be returned ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $topicPartition = new TopicPartition('test-topic', 0); $topicPartitionsWithOffsets = $consumer->getOffsetPositions([$topicPartition])); ``` \ No newline at end of file diff --git a/content/consumer/getSubscription.md b/content/consumer/getSubscription.md index 0db5b48..95f1ed4 100644 --- a/content/consumer/getSubscription.md +++ b/content/consumer/getSubscription.md @@ -10,9 +10,9 @@ public function getSubscription(): array {} Return topic names to which the consumer is currently subscribed to ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumer->subscribe(['test-topic']); var_dump($consumer->getSubscription()); ``` \ No newline at end of file diff --git a/content/consumer/getTopicHandle.md b/content/consumer/getTopicHandle.md index a4bf070..24b7f7b 100644 --- a/content/consumer/getTopicHandle.md +++ b/content/consumer/getTopicHandle.md @@ -11,9 +11,9 @@ Get a topic handle for a given topic name. A topic handle is needed for example to query metadata from the broker ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $topicHandle = $consumer->getTopicHandle('test-topic'); // use the topic handle for further calls, e.g. to query metadata diff --git a/content/consumer/offsetForTimes.md b/content/consumer/offsetForTimes.md index 266da62..3b436c8 100644 --- a/content/consumer/offsetForTimes.md +++ b/content/consumer/offsetForTimes.md @@ -13,9 +13,9 @@ timestamp is greater than or equal to the given timestamp in the corresponding partition. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $topicPartition = new TopicPartition('test-topic', 0, strtotime("-1 week")); $offsetsOneWeekAgo = $consumer->offsetForTimes([$topicPartition], 10000); ``` \ No newline at end of file diff --git a/content/consumer/queryWatermarkOffsets.md b/content/consumer/queryWatermarkOffsets.md index fe888fb..071e17e 100644 --- a/content/consumer/queryWatermarkOffsets.md +++ b/content/consumer/queryWatermarkOffsets.md @@ -13,9 +13,9 @@ Query broker for low (oldest) and high (newest) offsets for a partition $low = 0; $high = 0; -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $topicPartition = new TopicPartition('test-topic', 0, strtotime("-1 week")); $consumer->queryWatermarkOffsets('test-topic', 0, int &$low, int &$high, 10000); ``` \ No newline at end of file diff --git a/content/consumer/subscribe.md b/content/consumer/subscribe.md index 6ad2766..79044c8 100644 --- a/content/consumer/subscribe.md +++ b/content/consumer/subscribe.md @@ -12,8 +12,8 @@ Any previous subscription will be unassigned and unsubscribed first. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumer->subscribe(['test-topic']); ``` \ No newline at end of file diff --git a/content/consumer/unsubscribe.md b/content/consumer/unsubscribe.md index 01587dc..4c7dc51 100644 --- a/content/consumer/unsubscribe.md +++ b/content/consumer/unsubscribe.md @@ -11,9 +11,9 @@ Unsubscribe from the current subscriptions ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumer->subscribe(['test-topic']); $consumer->unsubscribe(); ``` \ No newline at end of file diff --git a/content/installation/_index.md b/content/installation/_index.md index c0329bf..f9c3d88 100644 --- a/content/installation/_index.md +++ b/content/installation/_index.md @@ -4,7 +4,9 @@ date: 2020-12-27T22:09:37+01:00 draft: false --- ## Installation with PECL -Not yet support (WIP) +``` +pecl install simple_kafka_client +``` ### Manual installation ```bash @@ -12,7 +14,7 @@ git clone https://github.com/php-kafka/php-simple-kafka-client.git cd php-simple-kafka-client phpize && ./configure && make -j5 all && make install ``` -In your `php/conf.d` folder add a `kafka.ini` with the following: +In your `php/conf.d` folder add a `simple_kafka_client.ini` with the following: ```ini -extension=kafka.so +extension=simple_kafka_client.so ``` diff --git a/content/kafkaException/__construct.md b/content/kafkaException/__construct.md index ad3c109..f20bfc8 100644 --- a/content/kafkaException/__construct.md +++ b/content/kafkaException/__construct.md @@ -17,7 +17,7 @@ public function __construct( Create new `KafkaErrorException`, this can be helpful for transaction tests ## Example ```php -throw new Kafka\KafkaErrorException( +throw new SimpleKafkaClient\KafkaErrorException( 'Some error message', 88, 'This is a detailed error string', diff --git a/content/kafkaException/getErrorString.md b/content/kafkaException/getErrorString.md index f3daf69..a8eaaab 100644 --- a/content/kafkaException/getErrorString.md +++ b/content/kafkaException/getErrorString.md @@ -10,12 +10,12 @@ public function getErrorString(): string {} Get error description for this exception ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); try { $producer->initTransactions(10000); -} catch (Kafka\KafkaErrorException $e) { +} catch (SimpleKafkaClient\KafkaErrorException $e) { echo $e->getErrorString(); } ``` \ No newline at end of file diff --git a/content/kafkaException/isFatal.md b/content/kafkaException/isFatal.md index b4e822a..8227ad7 100644 --- a/content/kafkaException/isFatal.md +++ b/content/kafkaException/isFatal.md @@ -10,12 +10,12 @@ public function isFatal(): bool {} Check if it is a fatal exception ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); try { $producer->initTransactions(10000); -} catch (Kafka\KafkaErrorException $e) { +} catch (SimpleKafkaClient\KafkaErrorException $e) { if ($e->isFatal()) { // non-recoverable error } diff --git a/content/kafkaException/isRetriable.md b/content/kafkaException/isRetriable.md index ea7b756..d965345 100644 --- a/content/kafkaException/isRetriable.md +++ b/content/kafkaException/isRetriable.md @@ -10,12 +10,12 @@ public function isRetriable(): bool {} Indicates that the operation that caused this exception can be retried. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); try { $producer->initTransactions(10000); -} catch (Kafka\KafkaErrorException $e) { +} catch (SimpleKafkaClient\KafkaErrorException $e) { if ($e->isRetriable()) { // action can be retried } diff --git a/content/kafkaException/transactionRequiresAbort.md b/content/kafkaException/transactionRequiresAbort.md index 6882630..d166859 100644 --- a/content/kafkaException/transactionRequiresAbort.md +++ b/content/kafkaException/transactionRequiresAbort.md @@ -10,12 +10,12 @@ public function transactionRequiresAbort(): bool {} Check if error needs the transaction to be aborted ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); try { $producer->initTransactions(10000); -} catch (Kafka\KafkaErrorException $e) { +} catch (SimpleKafkaClient\KafkaErrorException $e) { if ($e->$transactionRequiresAbort()) { $producer->abortTransaction(10000); } diff --git a/content/metadata/broker/getHost.md b/content/metadata/broker/getHost.md index 6596081..a6a0aca 100644 --- a/content/metadata/broker/getHost.md +++ b/content/metadata/broker/getHost.md @@ -11,9 +11,9 @@ public function getHost(): string {} Get host name of metadata broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Broker host: %s', $metadata->getBrokers()->current()->getHost()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/broker/getId.md b/content/metadata/broker/getId.md index 90932ad..da84d3b 100644 --- a/content/metadata/broker/getId.md +++ b/content/metadata/broker/getId.md @@ -11,9 +11,9 @@ public function getId(): int {} Get host id of metadata broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Broker id: %d', $metadata->getBrokers()->current()->getId()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/broker/getPort.md b/content/metadata/broker/getPort.md index 87ac1ef..ae9badb 100644 --- a/content/metadata/broker/getPort.md +++ b/content/metadata/broker/getPort.md @@ -11,9 +11,9 @@ public function getPort(): int {} Get host port of metadata broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Broker port: %d', $metadata->getBrokers()->current()->getPort()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/metadata/getBrokers.md b/content/metadata/metadata/getBrokers.md index 7240444..210e170 100644 --- a/content/metadata/metadata/getBrokers.md +++ b/content/metadata/metadata/getBrokers.md @@ -12,9 +12,9 @@ Get metadata of all brokers Will return a `Metadata\Collection` of `Metadata\Broker` ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo $metadata->getBrokers()->current()->getHost() . PHP_EOL; echo $metadata->getBrokers()->current()->getPort() . PHP_EOL; diff --git a/content/metadata/metadata/getOrigBrokerId.md b/content/metadata/metadata/getOrigBrokerId.md index 09def6e..7b03f7b 100644 --- a/content/metadata/metadata/getOrigBrokerId.md +++ b/content/metadata/metadata/getOrigBrokerId.md @@ -11,9 +11,9 @@ public function getOrigBrokerId(): int {} Get broker id originating this metadata ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Broker id: %d', $metadata->getOrigBrokerId()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/metadata/getOrigBrokerName.md b/content/metadata/metadata/getOrigBrokerName.md index a081604..b6ed940 100644 --- a/content/metadata/metadata/getOrigBrokerName.md +++ b/content/metadata/metadata/getOrigBrokerName.md @@ -11,9 +11,9 @@ public function getOrigBrokerName(): string {} Get broker name originating this metadata ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Broker id: %d', $metadata->getOrigBrokerName()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/metadata/getTopics.md b/content/metadata/metadata/getTopics.md index 362a3cb..d292af3 100644 --- a/content/metadata/metadata/getTopics.md +++ b/content/metadata/metadata/getTopics.md @@ -12,9 +12,9 @@ Get metadata of all topics (or a single topic if one was provided) Will return a `Metadata\Collection` of `Metadata\Topic` ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo 'Info about topics' . PHP_EOL; $topics = $metadata->getTopics(); diff --git a/content/metadata/partition/getErrorCode.md b/content/metadata/partition/getErrorCode.md index 2762828..56d2301 100644 --- a/content/metadata/partition/getErrorCode.md +++ b/content/metadata/partition/getErrorCode.md @@ -11,9 +11,9 @@ public function getErrorCode(): int {} Topic partition error code reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf( 'Topic partition error code: %d', diff --git a/content/metadata/partition/getId.md b/content/metadata/partition/getId.md index 5cb2f5f..d2c9766 100644 --- a/content/metadata/partition/getId.md +++ b/content/metadata/partition/getId.md @@ -11,9 +11,9 @@ public function getId(): int {} Topic partition id reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf( 'Topic partition id: %d', diff --git a/content/metadata/partition/getIsrs.md b/content/metadata/partition/getIsrs.md index b6f63e6..3ea1ce5 100644 --- a/content/metadata/partition/getIsrs.md +++ b/content/metadata/partition/getIsrs.md @@ -11,9 +11,9 @@ public function getIsrs(): Collection {} Topic partition in-sync replicas reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); $isrs = $metadata->getTopics()->current()->getPartitions()->current()->getIsrs(); while ($isrs->valid()) { diff --git a/content/metadata/partition/getLeader.md b/content/metadata/partition/getLeader.md index 43d353f..8f8aa5f 100644 --- a/content/metadata/partition/getLeader.md +++ b/content/metadata/partition/getLeader.md @@ -11,9 +11,9 @@ public function getLeader(): int {} Topic partition leader id reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf( 'Topic partition leader: %d', diff --git a/content/metadata/partition/getReplicas.md b/content/metadata/partition/getReplicas.md index e75da1e..cc2abb7 100644 --- a/content/metadata/partition/getReplicas.md +++ b/content/metadata/partition/getReplicas.md @@ -11,9 +11,9 @@ public function getReplicas(): Collection {} Topic partition replicas reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); $replicas = $metadata->getTopics()->current()->getPartitions()->current()->getReplicas(); while ($replicas->valid()) { diff --git a/content/metadata/topic/getErrorCode.md b/content/metadata/topic/getErrorCode.md index 57a08de..cb6508f 100644 --- a/content/metadata/topic/getErrorCode.md +++ b/content/metadata/topic/getErrorCode.md @@ -11,9 +11,9 @@ public function getErrorCode(): int {} Topic error code reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Topic error code: %d', $metadata->getTopics()->current()->getErrorCode()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/topic/getName.md b/content/metadata/topic/getName.md index 11b177a..9012b15 100644 --- a/content/metadata/topic/getName.md +++ b/content/metadata/topic/getName.md @@ -11,9 +11,9 @@ public function getName(): string {} Topic name reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); echo sprintf('Topic name: %d', $metadata->getTopics()->current()->getName()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/metadata/topic/getPartitions.md b/content/metadata/topic/getPartitions.md index a22587d..e09575b 100644 --- a/content/metadata/topic/getPartitions.md +++ b/content/metadata/topic/getPartitions.md @@ -11,9 +11,9 @@ public function getPartitions(): Collection {} Topic partitions reported by broker ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $metadata = $producer->getMetadata(false, 10000); $topicPartitionsMetadata = $metadata->getTopics()->current()->getPartitions(); ``` \ No newline at end of file diff --git a/content/producer/__construct.md b/content/producer/__construct.md index 1114d63..31d8b8d 100644 --- a/content/producer/__construct.md +++ b/content/producer/__construct.md @@ -10,7 +10,7 @@ public function __construct(Configuration $configuration) {} Get a producer instance ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); ``` \ No newline at end of file diff --git a/content/producer/abortTransaction.md b/content/producer/abortTransaction.md index 4335726..d54dedf 100644 --- a/content/producer/abortTransaction.md +++ b/content/producer/abortTransaction.md @@ -11,12 +11,12 @@ This function should also be used to recover from non-fatal abortable transactio Any outstanding messages will be purged and fail with `RD_KAFKA_RESP_ERR__PURGE_INFLIGHT` or `RD_KAFKA_RESP_ERR__PURGE_QUEUE`. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); try { $producer->initTransactions(10000); -} catch (Kafka\KafkaErrorException $e) { +} catch (SimpleKafkaClient\KafkaErrorException $e) { if ($e->$transactionRequiresAbort()) { $producer->abortTransaction(10000); } diff --git a/content/producer/beginTransaction.md b/content/producer/beginTransaction.md index c8d5237..184cf69 100644 --- a/content/producer/beginTransaction.md +++ b/content/producer/beginTransaction.md @@ -7,16 +7,16 @@ draft: false ```php public function beginTransaction(): void {} ``` -`Kafka\Producer::initTransactions()` must have been called successfully (once) +`SimpleKafkaClient\Producer::initTransactions()` must have been called successfully (once) before this function is called. Any messages produced, offsets sent, etc, after the successful return of this function will be part of the transaction and committed or aborted automatically. -Finish the transaction by calling `Kafka\Producer::commitTransaction()` -or abort the transaction by calling `Kafka\Producer::abortTransaction()` +Finish the transaction by calling `SimpleKafkaClient\Producer::commitTransaction()` +or abort the transaction by calling `SimpleKafkaClient\Producer::abortTransaction()` ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $producer->initTransactions(10000); $producer->beginTransaction(); // produce some messsages diff --git a/content/producer/commitTransaction.md b/content/producer/commitTransaction.md index c9677a5..79e5871 100644 --- a/content/producer/commitTransaction.md +++ b/content/producer/commitTransaction.md @@ -7,17 +7,17 @@ draft: false ```php public function commitTransaction(int $timeoutMs): void {} ``` -Commit the current transaction (as started with `Kafka\Producer::beginTransaction()`). +Commit the current transaction (as started with `SimpleKafkaClient\Producer::beginTransaction()`). Any outstanding messages will be flushed (delivered) before actually committing the transaction. If any of the outstanding messages fail permanently the current transaction will enter the abortable error state and this function will return an abortable error, in this case the -application must call `Kafka\Producer::abortTransaction()` before attempting a new -transaction with `Kafka\Producer::beginTransaction()`. +application must call `SimpleKafkaClient\Producer::abortTransaction()` before attempting a new +transaction with `SimpleKafkaClient\Producer::beginTransaction()`. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $producer->initTransactions(10000); $producer->beginTransaction(); // produce some messsages diff --git a/content/producer/flush.md b/content/producer/flush.md index 9efc0c7..1f4ee15 100644 --- a/content/producer/flush.md +++ b/content/producer/flush.md @@ -14,9 +14,9 @@ all queued and in-flight produce requests are completed before terminating. This function will call poll() and thus trigger callbacks. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); // produce some messsages $producer->flush(10000); ``` \ No newline at end of file diff --git a/content/producer/getMetadata.md b/content/producer/getMetadata.md index 109152f..16ed168 100644 --- a/content/producer/getMetadata.md +++ b/content/producer/getMetadata.md @@ -10,9 +10,9 @@ function getMetadata(bool $allTopics, int $timeoutMs, ConsumerTopic $topic = nul Get metadata for all topics or a single topic ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $topicHandle = $producer->getTopicHandle('test-topic'); $singleTopicMetadata = $producer->metadata(true, $topicHandle, 10000); ``` \ No newline at end of file diff --git a/content/producer/getTopicHandle.md b/content/producer/getTopicHandle.md index 7a7cd39..c15d3bf 100644 --- a/content/producer/getTopicHandle.md +++ b/content/producer/getTopicHandle.md @@ -11,9 +11,9 @@ Get a topic handle for a given topic name. A topic handle is needed for example to query metadata from the broker ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $topicHandle = $producer->getTopicHandle('test-topic'); // use the topic handle for further calls, e.g. to query metadata diff --git a/content/producer/initTransactions.md b/content/producer/initTransactions.md index 55d0f71..6f7baa6 100644 --- a/content/producer/initTransactions.md +++ b/content/producer/initTransactions.md @@ -15,12 +15,12 @@ transaction will be aborted. This function needs to be called before any other transactional or produce functions are called when the `transactional.id` is configured. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); try { $producer->initTransactions(10000); -} catch (Kafka\KafkaErrorException $e) { +} catch (SimpleKafkaClient\KafkaErrorException $e) { if ($e->$transactionRequiresAbort()) { $producer->abortTransaction(10000); } diff --git a/content/producer/offsetForTimes.md b/content/producer/offsetForTimes.md index 1f235e7..22727fa 100644 --- a/content/producer/offsetForTimes.md +++ b/content/producer/offsetForTimes.md @@ -13,9 +13,9 @@ timestamp is greater than or equal to the given timestamp in the corresponding partition. ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $topicPartition = new TopicPartition('test-topic', 0, strtotime("-1 week")); $offsetsOneWeekAgo = $producer->offsetForTimes([$topicPartition], 10000); ``` \ No newline at end of file diff --git a/content/producer/poll.md b/content/producer/poll.md index 9bdc486..4391fbb 100644 --- a/content/producer/poll.md +++ b/content/producer/poll.md @@ -10,9 +10,9 @@ public function poll(int $timeoutMs): int {} Polls for events, provided callbacks will be called accordingly ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); // produce some messsages $producer->poll(0); ``` diff --git a/content/producer/purge.md b/content/producer/purge.md index ce1f9d4..b49504a 100644 --- a/content/producer/purge.md +++ b/content/producer/purge.md @@ -19,9 +19,9 @@ to or from the broker will fail with the error code set to `RD_KAFKA_RESP_ERR__P - `RD_KAFKA_PURGE_F_NON_BLOCKING` make the call non-blocking ## Example ```php -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); // produce some messsages $producer->purge(RD_KAFKA_PURGE_F_QUEUE); ``` \ No newline at end of file diff --git a/content/producer/queryWatermarkOffsets.md b/content/producer/queryWatermarkOffsets.md index 46a0afb..cb20ba9 100644 --- a/content/producer/queryWatermarkOffsets.md +++ b/content/producer/queryWatermarkOffsets.md @@ -13,9 +13,9 @@ Query broker for low (oldest) and high (newest) offsets for a partition $low = 0; $high = 0; -$conf = Kafka\Configuration(); +$conf = SimpleKafkaClient\Configuration(); $conf->set('metadata.broker.list', 'kafka:9092'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $topicPartition = new TopicPartition('test-topic', 0, strtotime("-1 week")); $producer->queryWatermarkOffsets('test-topic', 0, int &$low, int &$high, 10000); ``` \ No newline at end of file diff --git a/content/topicHandles/consumerTopic/getName.md b/content/topicHandles/consumerTopic/getName.md index 5575f52..01549ed 100644 --- a/content/topicHandles/consumerTopic/getName.md +++ b/content/topicHandles/consumerTopic/getName.md @@ -11,9 +11,9 @@ public function getName(): string {} Get topic name ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$consumer = new Kafka\Consumer($conf); +$consumer = new SimpleKafkaClient\Consumer($conf); $consumerTopic = $consumer->getTopicHandle('test-topic'); echo sprintf('Topic name: %s', $consumerTopic->getName()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/topicHandles/prodcuerTopic/getName.md b/content/topicHandles/prodcuerTopic/getName.md index acc95d4..66952c3 100644 --- a/content/topicHandles/prodcuerTopic/getName.md +++ b/content/topicHandles/prodcuerTopic/getName.md @@ -11,9 +11,9 @@ public function getName(): string {} Get topic name ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $producerTopic = $producer->getTopicHandle('test-topic'); echo sprintf('Topic name: %s', $producerTopic->getName()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/topicHandles/prodcuerTopic/produce.md b/content/topicHandles/prodcuerTopic/produce.md index ba48870..558f3ef 100644 --- a/content/topicHandles/prodcuerTopic/produce.md +++ b/content/topicHandles/prodcuerTopic/produce.md @@ -21,9 +21,9 @@ msgflags: `0` or `RD_KAFKA_MSG_F_BLOCK` to block the producer if the queue is fu key: message key, if non-null the topic partitioner will calculate the partition according to the key ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $producerTopic = $producer->getTopicHandle('test-topic'); $producerTopic->produce( RD_KAFKA_PARTITION_UA, diff --git a/content/topicHandles/prodcuerTopic/producev.md b/content/topicHandles/prodcuerTopic/producev.md index 485a050..1eaf5ca 100644 --- a/content/topicHandles/prodcuerTopic/producev.md +++ b/content/topicHandles/prodcuerTopic/producev.md @@ -23,9 +23,9 @@ msgflags: `0` or `RD_KAFKA_MSG_F_BLOCK` to block the producer if the queue is fu key: message key, if non-null the topic partitioner will calculate the partition according to the key ## Example ```php -$conf = new Kafka\Configuration(); +$conf = new SimpleKafkaClient\Configuration(); $conf->set('auto.offset.reset', 'earliest'); -$producer = new Kafka\Producer($conf); +$producer = new SimpleKafkaClient\Producer($conf); $producerTopic = $producer->getTopicHandle('test-topic'); $producerTopic->produce( RD_KAFKA_PARTITION_UA, diff --git a/content/topicPartition/__construct.md b/content/topicPartition/__construct.md index d3e4a57..0f041fb 100644 --- a/content/topicPartition/__construct.md +++ b/content/topicPartition/__construct.md @@ -11,5 +11,5 @@ public function __construct(string $topicName, int $partition, int $offset = 0) Create new topic partition instance ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0); ``` \ No newline at end of file diff --git a/content/topicPartition/getOffset.md b/content/topicPartition/getOffset.md index 087c76a..39f8f6e 100644 --- a/content/topicPartition/getOffset.md +++ b/content/topicPartition/getOffset.md @@ -11,6 +11,6 @@ public function getOffset(): int {} Get offset of topic partition ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0, 100); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0, 100); echo sprintf('TopicPartition offset %d', $topicPartition->getOffset()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/topicPartition/getPartition.md b/content/topicPartition/getPartition.md index 9cdd92e..2f7ae99 100644 --- a/content/topicPartition/getPartition.md +++ b/content/topicPartition/getPartition.md @@ -11,6 +11,6 @@ public function getPartition(): int {} Get partition of topic partition ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0, 100); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0, 100); echo sprintf('TopicPartition partition %d', $topicPartition->getPartition()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/topicPartition/getTopicName.md b/content/topicPartition/getTopicName.md index 381bca8..0d01d33 100644 --- a/content/topicPartition/getTopicName.md +++ b/content/topicPartition/getTopicName.md @@ -11,6 +11,6 @@ public function getTopicName(): string {} Get topic name of topic partition ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0, 100); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0, 100); echo sprintf('Topic partition name %s', $topicPartition->getTopicName()) . PHP_EOL; ``` \ No newline at end of file diff --git a/content/topicPartition/setOffset.md b/content/topicPartition/setOffset.md index 59d4a59..be8fe04 100644 --- a/content/topicPartition/setOffset.md +++ b/content/topicPartition/setOffset.md @@ -11,6 +11,6 @@ public function setOffset(int $offset): TopicPartition {} Set offset of topic partition ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0); $topicPartition->setOffset(100); ``` \ No newline at end of file diff --git a/content/topicPartition/setPartition.md b/content/topicPartition/setPartition.md index 3996aa8..f097e43 100644 --- a/content/topicPartition/setPartition.md +++ b/content/topicPartition/setPartition.md @@ -11,6 +11,6 @@ public function setPartition(int $partition): TopicPartition {} Set partition of topic partition ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0); $topicPartition->setPartition(1); ``` \ No newline at end of file diff --git a/content/topicPartition/setTopicName.md b/content/topicPartition/setTopicName.md index 2f0f09b..3f0a18e 100644 --- a/content/topicPartition/setTopicName.md +++ b/content/topicPartition/setTopicName.md @@ -11,6 +11,6 @@ public function setTopicName(string $topicName): TopicPartition {} Set topic name of topic partition ## Example ```php -$topicPartition = new Kafka\TopicPartiton('test-topic', 0); +$topicPartition = new SimpleKafkaClient\TopicPartiton('test-topic', 0); $topicPartition->setTopicName('another-test-topic'); ``` \ No newline at end of file diff --git a/content/whats-new/release-1.0.0.md b/content/whats-new/release-0.1.0.md similarity index 76% rename from content/whats-new/release-1.0.0.md rename to content/whats-new/release-0.1.0.md index 4151fec..bd8b739 100644 --- a/content/whats-new/release-1.0.0.md +++ b/content/whats-new/release-0.1.0.md @@ -1,5 +1,5 @@ --- -title: "Release v1.0.0" +title: "Release v0.1.0" date: 2020-12-27T22:09:37+01:00 draft: false ---