aaron-ai commented on code in PR #528:
URL: https://github.com/apache/rocketmq-clients/pull/528#discussion_r1218815070
##########
python/rocketmq/rpc_client.py:
##########
@@ -67,6 +67,20 @@ async def send_message(
):
return await self.__stub.SendMessage(request, timeout=timeout_seconds)
+ async def receive_message(
+ self, request: service_pb2.ReceiveMessageRequest, timeout_seconds: int
+ ):
+ results = self.__stub.ReceiveMessage(request, timeout=timeout_seconds)
+ response = []
+ try:
+ async for result in results:
+ if result.HasField('message'):
+ response.append(result.message)
+ except Exception as e:
+ print(f"An error occurred: {e}")
Review Comment:
use logger rather than standard output.
--
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]