From 032ff8030e62a863116541091bbeb01e6849e42b Mon Sep 17 00:00:00 2001 From: Daniel Purnomo <87076947+kyooosukedn@users.noreply.github.com> Date: Fri, 26 Jan 2024 02:19:46 +0100 Subject: [PATCH] [ISSUE #4633] Optimize the message body of the Rust SDK's returned reply message (#4751) * optimized returned reply msg * corrected the change --- .../eventmesh-sdk-rust/src/grpc/grpc_consumer.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/eventmesh-sdks/eventmesh-sdk-rust/src/grpc/grpc_consumer.rs b/eventmesh-sdks/eventmesh-sdk-rust/src/grpc/grpc_consumer.rs index ad18ccd207..e31c97a530 100644 --- a/eventmesh-sdks/eventmesh-sdk-rust/src/grpc/grpc_consumer.rs +++ b/eventmesh-sdks/eventmesh-sdk-rust/src/grpc/grpc_consumer.rs @@ -146,17 +146,6 @@ impl EventMeshGrpcConsumer { let handled_msg = listener_inner.handle(eventmesh_message.unwrap()); if let Ok(msg_option) = handled_msg { if let Some(_msg) = msg_option { - let properties = HashMap::::new(); - let reply = SubscriptionReply::new( - EventMeshCloudEventUtils::get_subject(&received), - EventMeshCloudEventUtils::get_subject(&received), - EventMeshCloudEventUtils::get_data_content(&received), - EventMeshCloudEventUtils::get_seq_num(&received), - EventMeshCloudEventUtils::get_unique_id(&received), - EventMeshCloudEventUtils::get_ttl(&received), - None, - properties, - ); received.attributes.insert( ProtocolKey::SUB_MESSAGE_TYPE.to_string(), PbCloudEventAttributeValue { @@ -165,8 +154,7 @@ impl EventMeshGrpcConsumer { )), }, ); - received.data = - Some(PbData::TextData(serde_json::to_string(&reply).unwrap())); + received.data = None; let _ = keeper.sender.send(received).await; } } else {