Files
kiri-core/Kafka/Struct.php
T

35 lines
482 B
PHP
Raw Normal View History

2020-10-09 18:43:35 +08:00
<?php
namespace Kafka;
2020-10-26 17:23:22 +08:00
use RdKafka\Message;
2020-10-09 18:43:35 +08:00
class Struct
{
2020-10-26 17:23:22 +08:00
public int $offset;
2020-10-09 18:43:35 +08:00
2020-10-26 17:23:22 +08:00
public Message $message;
public string $topic;
2020-10-09 18:43:35 +08:00
2020-10-26 17:23:22 +08:00
public string $value;
public string $part;
2020-10-09 18:43:35 +08:00
/**
* Struct constructor.
* @param $topic
* @param $message
*/
2020-10-26 17:25:24 +08:00
public function __construct($topic, Message $message)
2020-10-09 18:43:35 +08:00
{
$this->topic = $topic;
2020-10-26 17:23:22 +08:00
$this->offset = $message->offset;
$this->part = $message->partition;
$this->message = $message;
$this->value = $message->payload;
2020-10-09 18:43:35 +08:00
}
}