-
Notifications
You must be signed in to change notification settings - Fork 161
[ISSUE #1611]🚀ClientRemotingProcessor supports RequestCode::ConsumeMessageDirectly(309)🔥 #1614
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -437,8 +437,8 @@ impl ConsumeMessageServiceTrait for ConsumeMessageOrderlyService { | |
|
||
async fn consume_message_directly( | ||
&self, | ||
msg: &MessageExt, | ||
broker_name: &str, | ||
msg: MessageExt, | ||
broker_name: Option<CheetahString>, | ||
) -> ConsumeMessageDirectlyResult { | ||
Comment on lines
+440
to
442
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implement The |
||
todo!() | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,8 +84,8 @@ impl ConsumeMessageServiceTrait for ConsumeMessagePopConcurrentlyService { | |
|
||
async fn consume_message_directly( | ||
&self, | ||
msg: &MessageExt, | ||
broker_name: &str, | ||
msg: MessageExt, | ||
broker_name: Option<CheetahString>, | ||
) -> ConsumeMessageDirectlyResult { | ||
Comment on lines
+87
to
89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implement The |
||
todo!() | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
*/ | ||
use std::sync::Arc; | ||
|
||
use cheetah_string::CheetahString; | ||
use rocketmq_common::common::message::message_client_ext::MessageClientExt; | ||
use rocketmq_common::common::message::message_ext::MessageExt; | ||
use rocketmq_common::common::message::message_queue::MessageQueue; | ||
|
@@ -54,8 +55,8 @@ impl ConsumeMessageServiceTrait for ConsumeMessagePopOrderlyService { | |
|
||
async fn consume_message_directly( | ||
&self, | ||
msg: &MessageExt, | ||
broker_name: &str, | ||
msg: MessageExt, | ||
broker_name: Option<CheetahString>, | ||
) -> ConsumeMessageDirectlyResult { | ||
Comment on lines
+58
to
60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implement The method |
||
todo!() | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
*/ | ||
use std::sync::Arc; | ||
|
||
use cheetah_string::CheetahString; | ||
use rocketmq_common::common::message::message_client_ext::MessageClientExt; | ||
use rocketmq_common::common::message::message_ext::MessageExt; | ||
use rocketmq_common::common::message::message_queue::MessageQueue; | ||
|
@@ -89,8 +90,8 @@ where | |
|
||
pub async fn consume_message_directly( | ||
&self, | ||
msg: &MessageExt, | ||
broker_name: &str, | ||
msg: MessageExt, | ||
broker_name: Option<CheetahString>, | ||
) -> ConsumeMessageDirectlyResult { | ||
todo!() | ||
} | ||
|
@@ -206,10 +207,10 @@ where | |
todo!() | ||
} | ||
|
||
async fn consume_message_directly( | ||
pub(crate) async fn consume_message_directly( | ||
&self, | ||
msg: &MessageExt, | ||
broker_name: &str, | ||
msg: MessageExt, | ||
broker_name: Option<CheetahString>, | ||
) -> ConsumeMessageDirectlyResult { | ||
todo!() | ||
Comment on lines
+210
to
215
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implementation missing for ConsumeMessagePopServiceGeneral The |
||
} | ||
|
@@ -249,8 +250,8 @@ pub trait ConsumeMessageServiceTrait { | |
|
||
async fn consume_message_directly( | ||
&self, | ||
msg: &MessageExt, | ||
broker_name: &str, | ||
msg: MessageExt, | ||
broker_name: Option<CheetahString>, | ||
) -> ConsumeMessageDirectlyResult; | ||
|
||
async fn submit_consume_request( | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -27,11 +27,13 @@ use rand::seq::SliceRandom; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::base::service_state::ServiceState; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::constant::PermName; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::filter::expression_type::ExpressionType; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::message::message_ext::MessageExt; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::message::message_queue::MessageQueue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::message::message_queue_assignment::MessageQueueAssignment; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::common::mix_all; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_common::TimeUtils::get_current_millis; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_remoting::base::connection_net_event::ConnectionNetEvent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_remoting::protocol::body::consume_message_directly_result::ConsumeMessageDirectlyResult; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_remoting::protocol::heartbeat::consumer_data::ConsumerData; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_remoting::protocol::heartbeat::heartbeat_data::HeartbeatData; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
use rocketmq_remoting::protocol::heartbeat::message_model::MessageModel; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -1182,6 +1184,23 @@ impl MQClientInstance { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ok(None) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pub async fn consume_message_directly( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
&self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
message: MessageExt, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
consumer_group: &CheetahString, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
broker_name: Option<CheetahString>, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) -> Option<ConsumeMessageDirectlyResult> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let consumer_table = self.consumer_table.read().await; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let consumer_inner = consumer_table.get(consumer_group); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if let Some(consumer) = consumer_inner { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
consumer | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.consume_message_directly(message, broker_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.await; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
None | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1188
to
+1203
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix critical bug in return value handling The implementation ignores the result of Apply this fix: pub async fn consume_message_directly(
&self,
message: MessageExt,
consumer_group: &CheetahString,
broker_name: Option<CheetahString>,
) -> Option<ConsumeMessageDirectlyResult> {
let consumer_table = self.consumer_table.read().await;
let consumer_inner = consumer_table.get(consumer_group);
if let Some(consumer) = consumer_inner {
- consumer
+ return consumer
.consume_message_directly(message, broker_name)
- .await;
+ .await
}
None
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
pub fn topic_route_data2topic_publish_info( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement
consume_message_directly
methodThe
consume_message_directly
method currently contains atodo!()
placeholder. Please provide an implementation to support direct message consumption functionality.