Skip to content

Commit

Permalink
dekaf: Add a hint for passing a collection name as a topic name, when…
Browse files Browse the repository at this point in the history
… the binding has renamed that topic
  • Loading branch information
jshearer committed Nov 26, 2024
1 parent eb14f3f commit 0d332d6
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions crates/dekaf/src/topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,23 @@ impl Collection {
task_auth.task_name
)
}
} else {
} else if let Some(suggested_binding) = task_auth
.spec
.bindings
.iter()
.find(|b| b.source.collection().to_string() == topic_name)
{
let correct_topic_name = serde_json::from_value::<
crate::connector::DekafResourceConfig,
>(suggested_binding.resource.to_value())?
.topic_name;
bail!(
"Unable to find binding for topic {topic_name} is not a binding of {}",
task_auth.task_name
"{topic_name} is not a binding of {}. Did you mean {}?",
task_auth.task_name,
correct_topic_name
)
} else {
bail!("{topic_name} is not a binding of {}", task_auth.task_name)
}
}

Expand Down

0 comments on commit 0d332d6

Please sign in to comment.