diff --git a/.env.example b/.env.example index 91a7499..d5327c9 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,4 @@ RUST_LOG="" -PULSAR_USER="" -PULSAR_PASSWD="" PULSAR_HOST="" PULSAR_PORT="" PULSAR_CONSUMER_NAME="" diff --git a/src/lib.rs b/src/lib.rs index be3035f..84c2c89 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,15 +6,10 @@ use std::str; #[derive(Deserialize, Debug)] pub struct Config { // Pulsar - #[serde(default = "default_user_pass")] - pub pulsar_user: String, - #[serde(default = "default_user_pass")] - pub pulsar_passwd: String, #[serde(default = "default_host")] pub pulsar_host: String, #[serde(default = "default_port")] pub pulsar_port: String, - pub pulsar_topics: String, #[serde(default = "default_consumer_name")] pub pulsar_consumer_name: String, #[serde(default = "default_subscription_name")] diff --git a/src/main.rs b/src/main.rs index caf80ce..81c8b8d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,6 +101,18 @@ async fn main() -> Result<(), anyhow::Error> { } }; + // skip events where the event data's outcome is "fail" + if let Some(outcome) = data.data.get("outcome").and_then(|v| v.as_str()) { + if outcome.eq_ignore_ascii_case("fail") { + log::error!( + "Problem: Skipping event with outcome 'fail' (type: {}, correlation_id: {})", + &data.type_field, + &data.correlation_id + ); + continue; + } + } + counter += 1; log::trace!("got {} messages", counter); log::debug!("{:?}", &data);