You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/18 04:00:17 UTC

[GitHub] [rocketmq] bendan365 commented on issue #5728: Proxy ReceiveMessage the response data is "null. NullPointerException. org.apache.rocketmq.proxy.grpc.v2.consumer.ReceiveMessageActivity.receiveMessage(ReceiveMessageActivity.java:65)"

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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org