pub struct MessageVersioningMiddleware { /* private fields */ }Expand description
Message versioning middleware - handle message schema versions
§Examples
use celers_kombu::MessageVersioningMiddleware;
// Basic versioning with current version
let versioning = MessageVersioningMiddleware::new("2.0");
// With backward compatibility
let compat_versioning = MessageVersioningMiddleware::new("3.0")
.with_min_supported_version("2.5")
.with_auto_upgrade(true);Implementations§
Source§impl MessageVersioningMiddleware
impl MessageVersioningMiddleware
Sourcepub fn new(current_version: impl Into<String>) -> Self
pub fn new(current_version: impl Into<String>) -> Self
Create a new message versioning middleware
Sourcepub fn with_min_supported_version(self, version: impl Into<String>) -> Self
pub fn with_min_supported_version(self, version: impl Into<String>) -> Self
Set minimum supported version
Sourcepub fn with_auto_upgrade(self, enabled: bool) -> Self
pub fn with_auto_upgrade(self, enabled: bool) -> Self
Enable auto-upgrade of messages
Trait Implementations§
Source§impl MessageMiddleware for MessageVersioningMiddleware
impl MessageMiddleware for MessageVersioningMiddleware
Source§fn before_publish<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 mut Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_publish<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 mut Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process message before publishing
Auto Trait Implementations§
impl Freeze for MessageVersioningMiddleware
impl RefUnwindSafe for MessageVersioningMiddleware
impl Send for MessageVersioningMiddleware
impl Sync for MessageVersioningMiddleware
impl Unpin for MessageVersioningMiddleware
impl UnsafeUnpin for MessageVersioningMiddleware
impl UnwindSafe for MessageVersioningMiddleware
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