From 901cf8c760daa2784ef99c3858d53191b7cca80a Mon Sep 17 00:00:00 2001 From: Yurun Date: Mon, 23 Oct 2023 13:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=BD=BF=E7=94=A8BaseInjectV?= =?UTF-8?q?alue=E4=BD=9C=E4=B8=BA=E6=B3=A8=E8=A7=A3=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kafka/example/Annotation/GetGroupId.php | 39 ------------------- ...estConsumer.php => TestConsumerSwoole.php} | 7 ++-- .../Kafka/Test/TestConsumerWorkerman.php | 29 ++++++++++++++ .../example/Process/SwooleTestProcess.php | 4 +- .../example/Process/WorkermanTestProcess.php | 4 +- 5 files changed, 36 insertions(+), 47 deletions(-) delete mode 100644 src/Components/kafka/example/Annotation/GetGroupId.php rename src/Components/kafka/example/Kafka/Test/{TestConsumer.php => TestConsumerSwoole.php} (77%) create mode 100644 src/Components/kafka/example/Kafka/Test/TestConsumerWorkerman.php diff --git a/src/Components/kafka/example/Annotation/GetGroupId.php b/src/Components/kafka/example/Annotation/GetGroupId.php deleted file mode 100644 index 1708731809..0000000000 --- a/src/Components/kafka/example/Annotation/GetGroupId.php +++ /dev/null @@ -1,39 +0,0 @@ -getValue(), true); + var_dump(__CLASS__, $message->getValue()); + Redis::set('imi-kafka:consume:1:' . $data['memberId'], $message->getValue()); + } +} diff --git a/src/Components/kafka/example/Process/SwooleTestProcess.php b/src/Components/kafka/example/Process/SwooleTestProcess.php index 08d04c97aa..8f8412b388 100644 --- a/src/Components/kafka/example/Process/SwooleTestProcess.php +++ b/src/Components/kafka/example/Process/SwooleTestProcess.php @@ -19,9 +19,9 @@ class SwooleTestProcess extends BaseProcess { /** - * @Inject("TestConsumer") + * @Inject("TestConsumerSwoole") * - * @var \KafkaApp\Kafka\Test\TestConsumer + * @var \KafkaApp\Kafka\Test\TestConsumerSwoole */ protected $testConsumer; diff --git a/src/Components/kafka/example/Process/WorkermanTestProcess.php b/src/Components/kafka/example/Process/WorkermanTestProcess.php index f3265a1ee0..93047f6baa 100644 --- a/src/Components/kafka/example/Process/WorkermanTestProcess.php +++ b/src/Components/kafka/example/Process/WorkermanTestProcess.php @@ -17,9 +17,9 @@ class WorkermanTestProcess extends BaseProcess { /** - * @Inject("TestConsumer") + * @Inject("TestConsumerWorkerman") * - * @var \KafkaApp\Kafka\Test\TestConsumer + * @var \KafkaApp\Kafka\Test\TestConsumerWorkerman */ protected $testConsumer;