Skip to content

Commit

Permalink
[ISSUE #1214]🔥Optimize Send message put PROPERTY_UNIQ_CLIENT_MESSAGE_…
Browse files Browse the repository at this point in the history
…ID_KEYIDX Property
  • Loading branch information
mxsm committed Nov 18, 2024
1 parent 7157b59 commit a32d712
Showing 1 changed file with 16 additions and 8 deletions.
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 @@ where
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

0 comments on commit a32d712

Please sign in to comment.