Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

orbs:
ci-caching: jobcloud/ci-caching@3.1
ci-php: jobcloud/ci-php@2.4
ci-php: jobcloud/ci-php@2.5

workflows:
test-php-kafka-lib:
Expand Down
5 changes: 1 addition & 4 deletions docker/dev/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ COPY files/php/ /phpIni

# SYS: Install required packages
RUN apk --no-cache upgrade && \
apk --no-cache add bash git sudo openssh autoconf gcc g++ make

RUN apk add librdkafka librdkafka-dev \
--update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community
apk --no-cache add bash git sudo openssh autoconf gcc g++ make librdkafka librdkafka-dev

# we need support for users with ID higher than 65k, so instead of using this:
#RUN adduser -u $HOST_USER_ID -D -H $HOST_USER
Expand Down
2 changes: 2 additions & 0 deletions src/Consumer/KafkaConsumerBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Jobcloud\Kafka\Consumer;

use Jobcloud\Kafka\Exception\KafkaConsumerBuilderException;
use Jobcloud\Kafka\Message\Decoder\DecoderInterface;

interface KafkaConsumerBuilderInterface
Expand Down Expand Up @@ -127,6 +128,7 @@ public function withLogCallback(callable $logCallback): KafkaConsumerBuilderInte
* Returns your consumer instance
*
* @return KafkaConsumerInterface
* @throws KafkaConsumerBuilderException
*/
public function build(): KafkaConsumerInterface;
}
8 changes: 8 additions & 0 deletions src/Consumer/KafkaConsumerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

namespace Jobcloud\Kafka\Consumer;

use Jobcloud\Kafka\Exception\KafkaConsumerConsumeException;
use Jobcloud\Kafka\Exception\KafkaConsumerEndOfPartitionException;
use Jobcloud\Kafka\Exception\KafkaConsumerTimeoutException;
use Jobcloud\Kafka\Message\KafkaConsumerMessageInterface;
use RdKafka\Exception as RdKafkaException;
use RdKafka\Metadata\Topic as RdKafkaMetadataTopic;
use RdKafka\TopicPartition as RdKafkaTopicPartition;

Expand Down Expand Up @@ -45,6 +49,9 @@ public function isSubscribed(): bool;
* @param integer $timeoutMs
* @param boolean $autoDecode
* @return KafkaConsumerMessageInterface
* @throws KafkaConsumerConsumeException
* @throws KafkaConsumerEndOfPartitionException
* @throws KafkaConsumerTimeoutException
*/
public function consume(int $timeoutMs = 10000, bool $autoDecode = true): KafkaConsumerMessageInterface;

Expand Down Expand Up @@ -77,6 +84,7 @@ public function getConfiguration(): array;
* @param string $topicName
* @param integer $timeoutMs
* @return RdKafkaMetadataTopic
* @throws RdKafkaException
*/
public function getMetadataForTopic(string $topicName, int $timeoutMs = 10000): RdKafkaMetadataTopic;

Expand Down
2 changes: 2 additions & 0 deletions src/Message/Decoder/DecoderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

namespace Jobcloud\Kafka\Message\Decoder;

use FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException;
use Jobcloud\Kafka\Message\KafkaConsumerMessageInterface;

interface DecoderInterface
{
/**
* @param KafkaConsumerMessageInterface $consumerMessage
* @return KafkaConsumerMessageInterface
* @throws SchemaRegistryException
*/
public function decode(KafkaConsumerMessageInterface $consumerMessage): KafkaConsumerMessageInterface;
}
4 changes: 4 additions & 0 deletions src/Message/Encoder/EncoderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@

namespace Jobcloud\Kafka\Message\Encoder;

use FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException;
use Jobcloud\Kafka\Exception\AvroEncoderException;
use Jobcloud\Kafka\Message\KafkaProducerMessageInterface;

interface EncoderInterface
{
/**
* @param KafkaProducerMessageInterface $producerMessage
* @return KafkaProducerMessageInterface
* @throws SchemaRegistryException
* @throws AvroEncoderException
*/
public function encode(KafkaProducerMessageInterface $producerMessage): KafkaProducerMessageInterface;
}
2 changes: 2 additions & 0 deletions src/Producer/KafkaProducerBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

namespace Jobcloud\Kafka\Producer;

use Jobcloud\Kafka\Exception\KafkaProducerException;
use Jobcloud\Kafka\Message\Encoder\EncoderInterface;

interface KafkaProducerBuilderInterface
{
/**
* @return KafkaProducerInterface
* @throws KafkaProducerException
*/
public function build(): KafkaProducerInterface;

Expand Down