pub struct DefaultMQPullConsumer { /* private fields */ }Classic Pull is retained for compatibility; prefer DefaultLitePullConsumer for new applications
Expand description
Java Classic Pull compatibility facade backed by the shared Rust client runtime.
Implementationsยง
Sourceยงimpl DefaultMQPullConsumer
impl DefaultMQPullConsumer
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a detached compatibility value.
Use Self::builder to obtain a runnable consumer. The detached constructor is retained
for source compatibility and fails closed on runtime operations.
Sourcepub fn with_consumer_group(consumer_group: impl Into<CheetahString>) -> Self
pub fn with_consumer_group(consumer_group: impl Into<CheetahString>) -> Self
Creates a detached compatibility value with a group name.
Sourcepub fn builder(
client_runtime: Arc<ClientRuntime>,
) -> DefaultMQPullConsumerBuilder
pub fn builder( client_runtime: Arc<ClientRuntime>, ) -> DefaultMQPullConsumerBuilder
Returns a builder that requires an application-owned runtime.
Sourcepub fn consumer_group(&self) -> Option<&CheetahString>
pub fn consumer_group(&self) -> Option<&CheetahString>
Returns the configured consumer group, if present.
Sourcepub fn client_config(&self) -> ClientResult<Arc<ClientConfig>>
pub fn client_config(&self) -> ClientResult<Arc<ClientConfig>>
Returns the client configuration used by this consumer.
ยงErrors
Returns an initialization error for a detached compatibility value.
Sourcepub async fn start(&self) -> ClientResult<()>
pub async fn start(&self) -> ClientResult<()>
Starts the consumer.
ยงErrors
Returns an initialization error for a detached value, a stable lifecycle error when the consumer was already started or shut down, or the underlying client startup error.
Sourcepub async fn shutdown(&self) -> ClientResult<()>
pub async fn shutdown(&self) -> ClientResult<()>
Shuts the consumer down and awaits its runtime-owned client and rebalance tasks.
ยงErrors
Returns an initialization error for a detached value or an underlying client shutdown error. Repeated shutdown is idempotent.
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Returns whether the consumer is running.
Sourcepub async fn pull(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
) -> ClientResult<PullResult>
pub async fn pull( &self, message_queue: &MessageQueue, sub_expression: &str, offset: i64, max_messages: i32, ) -> ClientResult<PullResult>
Pulls by tag expression using the default ordinary-pull timeout.
ยงErrors
Returns an error when the consumer is not running, the arguments are invalid, route or transport resolution fails, the broker rejects the request, or the request times out.
Sourcepub async fn pull_with_selector(
&self,
message_queue: &MessageQueue,
selector: MessageSelector,
offset: i64,
max_messages: i32,
) -> ClientResult<PullResult>
pub async fn pull_with_selector( &self, message_queue: &MessageQueue, selector: MessageSelector, offset: i64, max_messages: i32, ) -> ClientResult<PullResult>
Pulls with an explicit TAG or SQL selector.
ยงErrors
Returns the same validation, lifecycle, transport, broker, and timeout errors as
Self::pull.
Sourcepub async fn pull_async<C>(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
pub async fn pull_async<C>(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
Starts an asynchronous tag pull using the Java-compatible narrow signature.
ยงErrors
Returns an error before scheduling when validation, lifecycle, route resolution, or the initial transport request fails. Later failures are delivered to the callback.
Sourcepub async fn pull_async_with_selector<C>(
&self,
message_queue: &MessageQueue,
selector: MessageSelector,
offset: i64,
max_messages: i32,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
pub async fn pull_async_with_selector<C>(
&self,
message_queue: &MessageQueue,
selector: MessageSelector,
offset: i64,
max_messages: i32,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
Starts an asynchronous pull with an explicit TAG or SQL selector.
ยงErrors
Returns an error before scheduling when validation, lifecycle, route resolution, or the initial transport request fails. Later failures are delivered to the callback.
Sourcepub async fn pull_with_options(
&self,
options: PullOptions,
) -> ClientResult<PullResult>
pub async fn pull_with_options( &self, options: PullOptions, ) -> ClientResult<PullResult>
Pulls using a fully typed option set.
ยงErrors
Returns a validation, lifecycle, route, transport, broker, or timeout error.
Sourcepub async fn pull_block_if_not_found(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
) -> ClientResult<PullResult>
pub async fn pull_block_if_not_found( &self, message_queue: &MessageQueue, sub_expression: &str, offset: i64, max_messages: i32, ) -> ClientResult<PullResult>
Pulls with broker suspension when no message is immediately available.
ยงErrors
Returns a validation, lifecycle, route, transport, broker, or timeout error.
Sourcepub async fn pull_async_with_options<C>(
&self,
options: PullOptions,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
pub async fn pull_async_with_options<C>(
&self,
options: PullOptions,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
Starts an asynchronous pull whose completion runs on the clientโs callback executor.
ยงErrors
Returns an error before scheduling when validation, lifecycle, route resolution, or the initial transport request fails. Later failures are delivered to the callback.
Sourcepub async fn pull_block_if_not_found_async<C>(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
pub async fn pull_block_if_not_found_async<C>(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
callback: C,
) -> ClientResult<()>where
C: ClassicPullCallback,
Starts an asynchronous block-if-not-found pull.
ยงErrors
Returns an error before scheduling when validation, lifecycle, route resolution, or the initial transport request fails. Later failures are delivered to the callback.
Sourcepub async fn fetch_subscribe_message_queues(
&self,
topic: &str,
) -> ClientResult<Vec<MessageQueue>>
pub async fn fetch_subscribe_message_queues( &self, topic: &str, ) -> ClientResult<Vec<MessageQueue>>
Fetches all readable queues for a topic.
ยงErrors
Returns an error when the consumer is not running or topic route lookup fails.
Sourcepub async fn register_message_queue_listener<L>(
&self,
topic: &str,
listener: L,
) -> ClientResult<()>where
L: MessageQueueListener + 'static,
pub async fn register_message_queue_listener<L>(
&self,
topic: &str,
listener: L,
) -> ClientResult<()>where
L: MessageQueueListener + 'static,
Registers a listener for stable topic queue-set changes.
ยงErrors
Returns an error for a blank topic, a detached consumer, or a failed running-consumer subscription update.
Sourcepub async fn update_consume_offset(
&self,
message_queue: &MessageQueue,
offset: i64,
) -> ClientResult<()>
pub async fn update_consume_offset( &self, message_queue: &MessageQueue, offset: i64, ) -> ClientResult<()>
Updates the local consume offset for a queue.
ยงErrors
Returns an error when the consumer is not running, the offset is negative, or the offset store is unavailable.
Sourcepub async fn fetch_consume_offset(
&self,
message_queue: &MessageQueue,
from_store: bool,
) -> ClientResult<i64>
pub async fn fetch_consume_offset( &self, message_queue: &MessageQueue, from_store: bool, ) -> ClientResult<i64>
Fetches a queue offset from memory or the configured offset store.
ยงErrors
Returns an error when the consumer is not running, the offset store is unavailable, or a broker-backed read fails.
Sourcepub async fn search_offset(
&self,
message_queue: &MessageQueue,
timestamp: u64,
) -> ClientResult<i64>
pub async fn search_offset( &self, message_queue: &MessageQueue, timestamp: u64, ) -> ClientResult<i64>
Searches the queue offset nearest to a store timestamp.
ยงErrors
Returns an error when the consumer is not running or the broker query fails.
Sourcepub async fn max_offset(
&self,
message_queue: &MessageQueue,
) -> ClientResult<i64>
pub async fn max_offset( &self, message_queue: &MessageQueue, ) -> ClientResult<i64>
Returns the maximum queue offset.
ยงErrors
Returns an error when the consumer is not running or the broker query fails.
Sourcepub async fn min_offset(
&self,
message_queue: &MessageQueue,
) -> ClientResult<i64>
pub async fn min_offset( &self, message_queue: &MessageQueue, ) -> ClientResult<i64>
Returns the minimum queue offset.
ยงErrors
Returns an error when the consumer is not running or the broker query fails.
Sourcepub fn default_mq_pull_consumer_impl(
&self,
) -> ClientResult<DefaultMQPullConsumerImpl>
pub fn default_mq_pull_consumer_impl( &self, ) -> ClientResult<DefaultMQPullConsumerImpl>
Returns the functional implementation handle.
ยงErrors
Returns an initialization error for a detached compatibility value.
Trait Implementationsยง
Sourceยงimpl Clone for DefaultMQPullConsumer
impl Clone for DefaultMQPullConsumer
Sourceยงimpl Default for DefaultMQPullConsumer
impl Default for DefaultMQPullConsumer
Sourceยงimpl MQPullConsumer for DefaultMQPullConsumer
impl MQPullConsumer for DefaultMQPullConsumer
Sourceยงasync fn start(&self) -> ClientResult<()>
async fn start(&self) -> ClientResult<()>
Classic Pull is retained for compatibility; prefer DefaultLitePullConsumer for new applications
Sourceยงasync fn shutdown(&self) -> ClientResult<()>
async fn shutdown(&self) -> ClientResult<()>
Classic Pull is retained for compatibility; prefer DefaultLitePullConsumer for new applications
Sourceยงasync fn pull(
&self,
message_queue: &MessageQueue,
sub_expression: &str,
offset: i64,
max_messages: i32,
) -> ClientResult<PullResult>
async fn pull( &self, message_queue: &MessageQueue, sub_expression: &str, offset: i64, max_messages: i32, ) -> ClientResult<PullResult>
Classic Pull is retained for compatibility; prefer DefaultLitePullConsumer for new applications
Auto Trait Implementationsยง
impl !RefUnwindSafe for DefaultMQPullConsumer
impl !UnwindSafe for DefaultMQPullConsumer
impl Freeze for DefaultMQPullConsumer
impl Send for DefaultMQPullConsumer
impl Sync for DefaultMQPullConsumer
impl Unpin for DefaultMQPullConsumer
impl UnsafeUnpin for DefaultMQPullConsumer
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> FmtForward for T
impl<T> FmtForward for T
Sourceยงfn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Sourceยงfn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Sourceยงfn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Sourceยงfn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Sourceยงfn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Sourceยงfn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Sourceยงfn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Sourceยงfn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงfn in_current_span(self) -> Instrumented<Self> โ
fn in_current_span(self) -> Instrumented<Self> โ
Sourceยงimpl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Sourceยงfn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Sourceยงfn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSourceยงfn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSourceยงfn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Sourceยงfn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Sourceยงfn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Sourceยงfn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Sourceยงfn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Sourceยงimpl<T> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Sourceยงimpl<T> Tap for T
impl<T> Tap for T
Sourceยงfn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSourceยงfn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSourceยงfn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSourceยงfn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSourceยงfn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSourceยงfn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSourceยงfn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Sourceยงfn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Sourceยงfn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Sourceยงfn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Sourceยงfn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Sourceยงfn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Sourceยงfn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.