Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(MPM-533): rdkafka6.0-support #67

Merged
merged 12 commits into from
Feb 21, 2022
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

orbs:
ci-caching: jobcloud/ci-caching@1.0.2
ci-php: jobcloud/ci-php@0.32
ci-caching: jobcloud/ci-caching@3.0
bajdzun marked this conversation as resolved.
Show resolved Hide resolved
ci-php: jobcloud/ci-php@2.1

workflows:
test-php-kafka-lib:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test: pcov-disable

static-analysis: pcov-disable
mkdir -p build/logs/phpstan
${PHPSTAN} analyse --no-progress --memory-limit=64
${PHPSTAN} analyse --no-progress

update-dependencies:
composer update
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"require": {
"php": "^7.3|^8.0",
"ext-rdkafka": "^4.0|^5.0",
"ext-rdkafka": "^4.0|^5.0|^6.0",
"ext-json": "*"
},
"require-dev": {
Expand All @@ -44,5 +44,10 @@
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"config": {
"allow-plugins": {
"infection/extension-installer": false
}
}
}
2 changes: 1 addition & 1 deletion docker/dev/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin -

# PHP: Install php extensions
RUN pecl channel-update pecl.php.net && \
pecl install rdkafka pcov && \
pecl install rdkafka-6.0.0 pcov && \
docker-php-ext-install pcntl && \
php-ext-enable rdkafka pcntl pcov

Expand Down
1 change: 0 additions & 1 deletion src/Callback/KafkaConsumerRebalanceCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

final class KafkaConsumerRebalanceCallback
{

/**
* @param RdKafkaConsumer $consumer
* @param integer $errorCode
Expand Down
1 change: 0 additions & 1 deletion src/Callback/KafkaErrorCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

final class KafkaErrorCallback
{

/**
* @param mixed $kafka
* @param integer $errorCode
Expand Down
1 change: 0 additions & 1 deletion src/Conf/KafkaConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

class KafkaConfiguration extends RdKafkaConf
{

/**
* @var string[]
*/
Expand Down
3 changes: 1 addition & 2 deletions src/Consumer/AbstractKafkaConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

abstract class AbstractKafkaConsumer implements KafkaConsumerInterface
{

/**
* @var KafkaConfiguration
*/
Expand Down Expand Up @@ -231,7 +230,7 @@ protected function getConsumerMessage(RdKafkaMessage $message): KafkaConsumerMes
(int) $message->timestamp,
$message->key,
$message->payload,
(array) $message->headers
(array) ($message->headers ?? null)
);
}

Expand Down
1 change: 0 additions & 1 deletion src/Consumer/KafkaConsumerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

final class KafkaConsumerBuilder implements KafkaConsumerBuilderInterface
{

public const CONSUMER_TYPE_LOW_LEVEL = 'low';
public const CONSUMER_TYPE_HIGH_LEVEL = 'high';

Expand Down
1 change: 0 additions & 1 deletion src/Consumer/KafkaConsumerBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

interface KafkaConsumerBuilderInterface
{

public const OFFSET_BEGINNING = RD_KAFKA_OFFSET_BEGINNING;
public const OFFSET_END = RD_KAFKA_OFFSET_END;
public const OFFSET_STORED = RD_KAFKA_OFFSET_STORED;
Expand Down
1 change: 0 additions & 1 deletion src/Consumer/KafkaHighLevelConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

final class KafkaHighLevelConsumer extends AbstractKafkaConsumer implements KafkaHighLevelConsumerInterface
{

/**
* @var RdKafkaHighLevelConsumer
*/
Expand Down
1 change: 0 additions & 1 deletion src/Consumer/KafkaLowLevelConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

final class KafkaLowLevelConsumer extends AbstractKafkaConsumer implements KafkaLowLevelConsumerInterface
{

/**
* @var RdKafkaLowLevelConsumer
*/
Expand Down
1 change: 0 additions & 1 deletion src/Consumer/KafkaLowLevelConsumerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

interface KafkaLowLevelConsumerInterface extends KafkaConsumerInterface
{

}
1 change: 0 additions & 1 deletion src/Consumer/TopicSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

final class TopicSubscription implements TopicSubscriptionInterface
{

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion src/Consumer/TopicSubscriptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

interface TopicSubscriptionInterface
{

/**
* @return string
*/
Expand Down
1 change: 0 additions & 1 deletion src/Exception/KafkaConsumerConsumeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class KafkaConsumerConsumeException extends \Exception
{

public const NOT_SUBSCRIBED_EXCEPTION_MESSAGE = 'This consumer is currently not subscribed';

/**
Expand Down
1 change: 0 additions & 1 deletion src/Exception/KafkaConsumerEndOfPartitionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class KafkaConsumerEndOfPartitionException extends \Exception
{

}
1 change: 0 additions & 1 deletion src/Exception/KafkaConsumerTimeoutException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@

class KafkaConsumerTimeoutException extends \Exception
{

}
1 change: 0 additions & 1 deletion src/Message/AbstractKafkaMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

abstract class AbstractKafkaMessage implements KafkaMessageInterface
{

/**
* @var string|null
*/
Expand Down
1 change: 0 additions & 1 deletion src/Message/Decoder/JsonDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class JsonDecoder implements DecoderInterface
{

/**
* @param KafkaConsumerMessageInterface $consumerMessage
* @return KafkaConsumerMessageInterface
Expand Down
1 change: 0 additions & 1 deletion src/Message/Decoder/NullDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

final class NullDecoder implements DecoderInterface
{

/**
* @param KafkaConsumerMessageInterface $consumerMessage
* @return KafkaConsumerMessageInterface
Expand Down
1 change: 0 additions & 1 deletion src/Message/Encoder/AvroEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

final class AvroEncoder implements AvroEncoderInterface
{

/**
* @var AvroSchemaRegistryInterface
*/
Expand Down
1 change: 0 additions & 1 deletion src/Message/Encoder/JsonEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

class JsonEncoder implements EncoderInterface
{

/**
* @param KafkaProducerMessageInterface $producerMessage
* @return KafkaProducerMessageInterface
Expand Down
1 change: 0 additions & 1 deletion src/Message/Encoder/NullEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

final class NullEncoder implements EncoderInterface
{

/**
* @param KafkaProducerMessageInterface $producerMessage
* @return KafkaProducerMessageInterface
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaAvroSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

final class KafkaAvroSchema implements KafkaAvroSchemaInterface
{

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaAvroSchemaInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

interface KafkaAvroSchemaInterface
{

public const LATEST_VERSION = -1;

/**
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaConsumerMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

final class KafkaConsumerMessage extends AbstractKafkaMessage implements KafkaConsumerMessageInterface
{

/**
* @var int
*/
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaConsumerMessageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

interface KafkaConsumerMessageInterface extends KafkaMessageInterface
{

/**
* @return integer
*/
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaMessageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

interface KafkaMessageInterface
{

/**
* Returns the message key or null if the message doesn't have a body
* @return mixed
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaProducerMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

final class KafkaProducerMessage extends AbstractKafkaMessage implements KafkaProducerMessageInterface
{

/**
* @param string $topicName
* @param integer $partition
Expand Down
1 change: 0 additions & 1 deletion src/Message/KafkaProducerMessageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

interface KafkaProducerMessageInterface extends KafkaMessageInterface
{

/**
* @param string $topicName
* @param integer $partition
Expand Down
1 change: 0 additions & 1 deletion src/Producer/KafkaProducer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

final class KafkaProducer implements KafkaProducerInterface
{

/**
* @var RdKafkaProducer
*/
Expand Down
1 change: 0 additions & 1 deletion src/Producer/KafkaProducerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

interface KafkaProducerInterface
{

/**
* @param KafkaProducerMessageInterface $message
* @param boolean $autoPoll
Expand Down