Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #1214]🔥Optimize Send message put PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX Property #1215

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions rocketmq-broker/src/processor/send_message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,22 @@
message_ext.message_ext_inner.message.flag = request_header.flag;

let uniq_key = ori_props.get(MessageConst::PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX);
let uniq_key_inner = match uniq_key {
Some(inner) if !inner.is_empty() => inner.clone(),
_ => CheetahString::from_string(MessageClientIDSetter::create_uniq_id()),
};
ori_props.insert(
CheetahString::from_static_str(MessageConst::PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX),
uniq_key_inner,
);
if !uniq_key.is_some_and(|uniq_key_inner| uniq_key_inner.is_empty()) {
ori_props.insert(
CheetahString::from_static_str(
MessageConst::PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX,
),
CheetahString::from_string(MessageClientIDSetter::create_uniq_id()),
);
}

Check warning on line 472 in rocketmq-broker/src/processor/send_message_processor.rs

View check run for this annotation

Codecov / codecov/patch

rocketmq-broker/src/processor/send_message_processor.rs#L465-L472

Added lines #L465 - L472 were not covered by tests
// let uniq_key_inner = match uniq_key {
// Some(inner) if !inner.is_empty() => inner.clone(),
// _ => CheetahString::from_string(MessageClientIDSetter::create_uniq_id()),
// };
// ori_props.insert(
// CheetahString::from_static_str(MessageConst::PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX),
// uniq_key_inner,
// );

let tra_flag = ori_props
.get(MessageConst::PROPERTY_TRANSACTION_PREPARED)
Expand Down
Loading