diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b4b39d..ed4cddf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Medullah Changelog medullah-web changelog file +## 0.19.4 (2024-09-08) +* feat(rabbitmq): return &mut Self for 'nack_on_failure' & 'requeue_on_failure' +* feat(rabbitmq): added 'execute_handler_asynchronously()' to alter state + ## 0.19.3 (2024-09-08) * fix(rabbitmq): separate exchange & routing key generic params to avoid first param influencing the second diff --git a/Cargo.lock b/Cargo.lock index 6226ad4..c338b47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1903,7 +1903,7 @@ dependencies = [ [[package]] name = "medullah-web" -version = "0.19.3" +version = "0.19.4" dependencies = [ "base64 0.22.1", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 0f856be..ddf1c24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "medullah-web" -version = "0.19.3" +version = "0.19.4" edition = "2021" license = "MIT" description = "Micro-Framework Base on Ntex" diff --git a/src/rabbitmq/mod.rs b/src/rabbitmq/mod.rs index 4d690a7..7d6b43c 100644 --- a/src/rabbitmq/mod.rs +++ b/src/rabbitmq/mod.rs @@ -85,12 +85,25 @@ impl RabbitMQ { }) } - pub fn nack_on_failure(&mut self, state: bool) { + /// Set whether to nack a message if the handler returns an error. + /// Default value is `true` + pub fn nack_on_failure(&mut self, state: bool) -> &mut Self { self.nack_on_failure = state; + self } - pub fn requeue_on_failure(&mut self, state: bool) { + /// Set whether to requeue a message if the handler returns an error. + /// Default value is `true` + pub fn requeue_on_failure(&mut self, state: bool) -> &mut Self { self.requeue_on_failure = state; + self + } + + /// Set whether the handler should be executed in the background (asynchronously) or not. + /// Default value is `true` + pub fn execute_handler_asynchronously(&mut self, state: bool) -> &mut Self { + self.execute_handler_asynchronously = state; + self } pub async fn declare_exchange(&mut self, exchange: &str, kind: ExchangeKind) -> AppResult<()> {