lizhanhui commented on code in PR #682:
URL: https://github.com/apache/rocketmq-clients/pull/682#discussion_r1497165946


##########
rust/src/producer.rs:
##########
@@ -118,7 +196,53 @@ impl Producer {
         Ok(())
     }
 
-    fn transform_messages_to_protobuf(
+    async fn handle_recover_orphaned_transaction_command<T: RPCClient + 
'static>(
+        mut rpc_client: T,
+        command: pb::RecoverOrphanedTransactionCommand,
+        transaction_checker: &Option<Box<TransactionChecker>>,
+        endpoints: Endpoints,
+    ) -> Result<(), ClientError> {
+        let transaction_id = command.transaction_id;
+        let message = command.message.unwrap();
+        let message_id = message
+            .system_properties
+            .as_ref()
+            .unwrap()

Review Comment:
   Prefer propagating error to the upper layer over unwrap, which may panic and 
crash the whole process. 



##########
rust/src/producer.rs:
##########
@@ -118,7 +196,53 @@ impl Producer {
         Ok(())
     }
 
-    fn transform_messages_to_protobuf(
+    async fn handle_recover_orphaned_transaction_command<T: RPCClient + 
'static>(
+        mut rpc_client: T,
+        command: pb::RecoverOrphanedTransactionCommand,
+        transaction_checker: &Option<Box<TransactionChecker>>,
+        endpoints: Endpoints,
+    ) -> Result<(), ClientError> {
+        let transaction_id = command.transaction_id;
+        let message = command.message.unwrap();
+        let message_id = message
+            .system_properties
+            .as_ref()
+            .unwrap()
+            .message_id
+            .clone();
+        let topic = message.topic.as_ref().unwrap().clone();

Review Comment:
   Same here



-- 
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-unsubscr...@rocketmq.apache.org

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

Reply via email to