pub struct MessageCommandHandler { /* private fields */ }Expand description
Handles message retrieval commands including peek and receive operations.
Provides functionality for retrieving messages from Service Bus queues in different modes - peeking (non-destructive) and receiving (with locks). Individual message operations are handled differently and require special setup.
§Examples
use quetty_server::service_bus_manager::command_handlers::MessageCommandHandler;
let handler = MessageCommandHandler::new(consumer_manager);
// Peek at messages without removing them
let response = handler.handle_peek_messages(10, None).await?;
// Receive messages with locks for processing
let response = handler.handle_receive_messages(5).await?;Implementations§
Source§impl MessageCommandHandler
impl MessageCommandHandler
pub fn new(consumer_manager: Arc<Mutex<ConsumerManager>>) -> Self
pub async fn handle_peek_messages( &self, max_count: u32, from_sequence: Option<i64>, ) -> Result<ServiceBusResponse, ServiceBusError>
pub async fn handle_receive_messages( &self, max_count: u32, ) -> Result<ServiceBusResponse, ServiceBusError>
pub async fn handle_complete_message( &self, _message_id: String, ) -> Result<ServiceBusResponse, ServiceBusError>
pub async fn handle_abandon_message( &self, _message_id: String, ) -> Result<ServiceBusResponse, ServiceBusError>
pub async fn handle_dead_letter_message( &self, _message_id: String, _reason: Option<String>, _error_description: Option<String>, ) -> Result<ServiceBusResponse, ServiceBusError>
Auto Trait Implementations§
impl !RefUnwindSafe for MessageCommandHandler
impl !UnwindSafe for MessageCommandHandler
impl Freeze for MessageCommandHandler
impl Send for MessageCommandHandler
impl Sync for MessageCommandHandler
impl Unpin for MessageCommandHandler
impl UnsafeUnpin for MessageCommandHandler
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
Mutably borrows from an owned value. Read more