pub enum AckingBehavior {
Manual,
Auto,
}Expand description
Defines how the consumed messages are acknowledged: explicitly or implicitly.
If transactional message handling is required, it is highly recommended to use the manual mode, as otherwise it is quite possible to lose messages.
Variants§
Manual
Messages must be explicitly acknowledged by the application logic.
This is the recommended mode for transactional message handling: a
message will not be removed from the queue until its [Envelope] is
explicitly finalized. This, however, means that some messages may end up
being processed more than once. Thus, this mode provides the
at-least-once message processing semantics.
Auto
Messages are implicitly pre-acknowledged by the server on delivery, before even reaching the application logic.
This mode will cause missed messages on consumption! Some messages may occasionally fall through the cracks before being handed to the consuming logic, and since the messages are implicitly pre-acknowledged — such messages will not be re-delivered or seen again.
If it is important to process each message no more than once, but occasional message loss is acceptable — this is the mode of choice.
For transactional handling with at-least-once semantics, use the manual mode.
This mode effectively disables the prefetch. The prefetch count refers to the count of unacknowledged messages pre-delivered to a consumer, and with implicit auto-acking there are no unacknowledged messages at all.
Trait Implementations§
Source§impl Clone for AckingBehavior
impl Clone for AckingBehavior
Source§fn clone(&self) -> AckingBehavior
fn clone(&self) -> AckingBehavior
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more