Class KafkaConsumer¶
Class \RdKafka\KafkaConsumer
- extends \RdKafka
Methods¶
__construct()¶
public __construct (
\RdKafka\Conf $conf
):
- Parameters
- conf
\RdKafka\Conf
__destruct()¶
public __destruct ( ):
assign()¶
public assign (
\RdKafka\TopicPartition[] $topic_partitions = null
): void
- Parameters
- topic_partitions
\RdKafka\TopicPartition[]
close()¶
public close ( ): void
commit()¶
public commit (
\RdKafka\Message|\RdKafka\TopicPartition[]|null $message_or_offsets = null
): void
- Parameters
- message_or_offsets
\RdKafka\Message|\RdKafka\TopicPartition[]|null
commitAsync()¶
public commitAsync (
\RdKafka\Message|\RdKafka\TopicPartition[]|null $message_or_offsets = null
): void
- Parameters
- message_or_offsets
\RdKafka\Message|\RdKafka\TopicPartition[]|null
consume()¶
public consume (
int $timeout_ms
): \RdKafka\Message
- Parameters
- timeout_ms
int
- Returns
\RdKafka\Message
getAssignment()¶
public getAssignment ( ): \RdKafka\TopicPartition[]
- Returns
\RdKafka\TopicPartition[]
getCommittedOffsets()¶
public getCommittedOffsets (
\RdKafka\TopicPartition[] $topics,
int $timeout_ms
): \RdKafka\TopicPartition[]
- Parameters
- topics
\RdKafka\TopicPartition[]
- timeout_ms
int
- Returns
\RdKafka\TopicPartition[]
getSubscription()¶
public getSubscription ( ): array
- Returns
array
newTopic()¶
public newTopic (
string $topic_name,
?\RdKafka\TopicConf $topic_conf = null
): \RdKafka\KafkaConsumerTopic
- Parameters
- topic_name
string
- topic_conf
?\RdKafka\TopicConf
- Returns
\RdKafka\KafkaConsumerTopic
offsetsForTimes()¶
public offsetsForTimes (
\RdKafka\TopicPartition[] $topicPartitions,
int $timeout_ms
): \RdKafka\TopicPartition[]
- Parameters
- topicPartitions
\RdKafka\TopicPartition[]
- timeout_ms
int
- Returns
\RdKafka\TopicPartition[]
subscribe()¶
public subscribe (
array $topics
): void
- Parameters
- topics
array
unsubscribe()¶
public unsubscribe ( ): void
Test Coverage 💛¶
- 💛 Lines: 87.94% (124 / 141)
- ❤️ Methods: 41.18% (7 / 17)