zhaohai666 commented on code in PR #1250:
URL: https://github.com/apache/rocketmq-clients/pull/1250#discussion_r3309754066


##########
php/LiteSimpleConsumer.php:
##########
@@ -0,0 +1,744 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+namespace Apache\Rocketmq;
+
+require_once __DIR__ . '/autoload.php';
+require_once __DIR__ . '/RpcClientManager.php';
+require_once __DIR__ . '/Logger.php';
+require_once __DIR__ . '/TelemetrySession.php';
+require_once __DIR__ . '/Signature.php';
+require_once __DIR__ . '/ClientConstants.php';
+require_once __DIR__ . '/SwooleCompat.php';
+require_once __DIR__ . '/OffsetOption.php';
+
+use Apache\Rocketmq\V2\MessagingServiceClient;
+use Apache\Rocketmq\V2\ReceiveMessageRequest;
+use Apache\Rocketmq\V2\AckMessageRequest;
+use Apache\Rocketmq\V2\AckMessageEntry;
+use Apache\Rocketmq\V2\ChangeInvisibleDurationRequest;
+use Apache\Rocketmq\V2\SyncLiteSubscriptionRequest;
+use Apache\Rocketmq\V2\NotifyClientTerminationRequest;
+use Apache\Rocketmq\V2\LiteSubscriptionAction;
+use Apache\Rocketmq\V2\Resource;
+use Apache\Rocketmq\V2\FilterExpression;
+use Apache\Rocketmq\V2\Settings;
+use Apache\Rocketmq\V2\ClientType;
+use Apache\Rocketmq\V2\UA;
+use Apache\Rocketmq\V2\Language;
+use Apache\Rocketmq\V2\TelemetryCommand;
+use Apache\Rocketmq\V2\Subscription;
+use Apache\Rocketmq\V2\SubscriptionEntry;
+use Grpc\ChannelCredentials;
+use Google\Protobuf\Duration;
+
+/**
+ * LiteSimpleConsumer - Simple (pull) consumer for lite topics.
+ *
+ * Extends the simple consumer with lite topic subscription management.
+ * Uses a parent topic and dynamically subscribes/unsubscribes lite topics.
+ *
+ * Usage:
+ *   $consumer = new LiteSimpleConsumer($endpoints, $consumerGroup, 
$parentTopic);
+ *   $consumer->subscribeLite('lite-topic-1');
+ *   $consumer->subscribeLite('lite-topic-2');
+ *   $consumer->start();
+ *   $messages = $consumer->receive(10, 30);
+ */
+class LiteSimpleConsumer
+{
+    private $client;
+    private $endpoints;
+    private $clientId;
+    private $consumerGroup;
+    private $parentTopic;
+    private $liteTopics = [];
+    private $telemetrySession;
+    private $isRunning = false;
+    private $awaitDuration = 30;
+    private $receiveBatchSize = 32;
+    private $liteSubscriptionQuota = 0;
+    private $maxLiteTopicSize = 64;
+    private $tlsCredentials = null;
+    private $logger;
+
+    /**
+     * Constructor.
+     *
+     * @param string $endpoints gRPC server endpoint
+     * @param string $consumerGroup Consumer group name
+     * @param string $parentTopic Parent topic
+     * @param array $options Configuration options
+     */
+    public function __construct($endpoints, $consumerGroup, $parentTopic, 
$options = [])
+    {
+        $this->endpoints = $endpoints;
+        if (empty($consumerGroup)) {
+            throw new \InvalidArgumentException("LiteSimpleConsumer 
consumerGroup cannot be empty");
+        }
+        $this->consumerGroup = $consumerGroup;
+        if (empty(trim($parentTopic))) {
+            throw new \InvalidArgumentException("LiteSimpleConsumer 
parentTopic cannot be empty");
+        }
+        $this->parentTopic = $parentTopic;
+        $this->clientId = $options['clientId'] ?? ('php-lite-simple-consumer-' 
. getmypid() . '-' . time());
+        $this->awaitDuration = $options['awaitDuration'] ?? 30;
+        $this->receiveBatchSize = $options['receiveBatchSize'] ?? 32;
+        $this->liteSubscriptionQuota = $options['liteSubscriptionQuota'] ?? 0;
+        $this->maxLiteTopicSize = $options['maxLiteTopicSize'] ?? 64;
+
+        $this->logger = Logger::getInstance('LiteSimpleConsumer');
+
+        // Use RpcClientManager for connection pooling
+        $this->client = RpcClientManager::getInstance()->getClient($endpoints, 
[
+            'credentials' => ChannelCredentials::createInsecure(),

Review Comment:
   The php/LiteSimpleConsumer.php file is no longer supported and has been 
removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to