diff --git a/rocketmq-client/src/producer/default_mq_producer.rs b/rocketmq-client/src/producer/default_mq_producer.rs index 932d3edfe..506ddd230 100644 --- a/rocketmq-client/src/producer/default_mq_producer.rs +++ b/rocketmq-client/src/producer/default_mq_producer.rs @@ -1137,13 +1137,14 @@ impl MQProducer for DefaultMQProducer { Ok(()) } - async fn send_batch_to_queue_with_callback( + async fn send_batch_to_queue_with_callback( &mut self, - msgs: Vec, + msgs: Vec, mq: MessageQueue, f: F, ) -> rocketmq_error::RocketMQResult<()> where + M: MessageTrait + Send + Sync, F: Fn(Option<&SendResult>, Option<&dyn std::error::Error>) + Send + Sync + 'static, { let batch = self.batch(msgs)?; diff --git a/rocketmq-client/src/producer/mq_producer.rs b/rocketmq-client/src/producer/mq_producer.rs index 1490ce710..4d6c3ce45 100644 --- a/rocketmq-client/src/producer/mq_producer.rs +++ b/rocketmq-client/src/producer/mq_producer.rs @@ -586,13 +586,14 @@ pub trait MQProducer { /// # Returns /// /// * `rocketmq_error::RocketMQResult<()>` - An empty result indicating success or failure. - async fn send_batch_to_queue_with_callback( + async fn send_batch_to_queue_with_callback( &mut self, - msgs: Vec, + msgs: Vec, mq: MessageQueue, f: F, ) -> rocketmq_error::RocketMQResult<()> where + M: MessageTrait + Send + Sync, F: Fn(Option<&SendResult>, Option<&dyn std::error::Error>) + Send + Sync + 'static; /// Sends a batch of messages to a specific message queue with a callback and a timeout. diff --git a/rocketmq-client/src/producer/transaction_mq_producer.rs b/rocketmq-client/src/producer/transaction_mq_producer.rs index 15d7a208c..fe52d3224 100644 --- a/rocketmq-client/src/producer/transaction_mq_producer.rs +++ b/rocketmq-client/src/producer/transaction_mq_producer.rs @@ -420,13 +420,14 @@ impl MQProducer for TransactionMQProducer { .await } - async fn send_batch_to_queue_with_callback( + async fn send_batch_to_queue_with_callback( &mut self, - msgs: Vec, + msgs: Vec, mq: MessageQueue, f: F, ) -> rocketmq_error::RocketMQResult<()> where + M: MessageTrait + Send + Sync, F: Fn(Option<&SendResult>, Option<&dyn std::error::Error>) + Send + Sync + 'static, { self.default_producer