bendan365 commented on issue #5728:
URL: https://github.com/apache/rocketmq/issues/5728#issuecomment-1356656885

    $clientId = "localhost@".$this->getRandStr(4) . '@' . rand(0, 10) . '@' . 
$this->getRandStr(10);  
           $client = new MessagingServiceClient('127.0.0.1:8081', 
               [
                   'credentials' => 
ChannelCredentials::createSsl(file_get_contents(__DIR__."\\rocketmq.crt")),
                   'grpc.ssl_target_name_override'=>'localhost',
                   'update_metadata' => function ($metaData) use ($clientId) {
                       $metaData['x-mq-client-id'] = [$clientId];
                       return $metaData;
                   }
               ]        
           );
           $request = new ReceiveMessageRequest();
           $mq = new MessageQueue();
   
           $resource = new Resource();
           $resource->setName('xlp_test_topic');
           $mq->setAcceptMessageTypes([MessageType::NORMAL]);
           $mq->setTopic($resource);
           $request->setMessageQueue($mq);
   
           $group = new Resource();
           $group->setName('xlp_test_consumer');
           $request->setGroup($group);
   
           $filterExpression = new FilterExpression();
           $filterExpression->setExpression("common_test");
           $filterExpression->setType(FilterType::TAG);
           $request->setFilterExpression($filterExpression);
   
           $duration = new Duration();
           $duration->setSeconds(10);
           $request->setInvisibleDuration($duration);
   
           $request->setBatchSize(2);
           $request->setAutoRenew(false);
   
           $serverStreamingCall = $client->ReceiveMessage($request);
   
   
           $response = $serverStreamingCall->responses();


-- 
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