Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
RUST_LOG=""
PULSAR_USER=""
PULSAR_PASSWD=""
PULSAR_HOST=""
PULSAR_PORT=""
PULSAR_CONSUMER_NAME=""
Expand Down
5 changes: 0 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
12 changes: 12 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down