Skip to content

Commit

Permalink
[ISSUE #4633] Optimize the message body of the Rust SDK's returned re…
Browse files Browse the repository at this point in the history
…ply message (#4751)

* optimized returned reply msg

* corrected the change
  • Loading branch information
kyooosukedn authored Jan 26, 2024
1 parent 73ab1d6 commit 032ff80
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions eventmesh-sdks/eventmesh-sdk-rust/src/grpc/grpc_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<String, String>::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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 032ff80

Please sign in to comment.