Verified Commit 5211c227 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

provide fallback if no client configurations were defined

parent e6a4b9ed
Pipeline #31536 passed with stages
in 10 minutes and 12 seconds
......@@ -52,8 +52,8 @@ fn main() -> Result<()> {
let input_topic = matches.value_of("input_topic").unwrap();
let consumer_configs = matches
.values_of("consumer_configs")
.context("consumer configs")?
.collect::<Vec<&str>>();
.and_then(|v| Some(v.collect::<Vec<&str>>()))
.unwrap_or(vec![]);
let consumer: BaseConsumer<ConsumerCallbackLogger> = kafka::create_client(
bootstrap_servers,
......
......@@ -135,12 +135,12 @@ fn main() -> Result<()> {
let output_topic = matches.value_of("output_topic").context("output topic")?;
let consumer_configs = matches
.values_of("consumer_configs")
.context("consumer configs")?
.collect::<Vec<&str>>();
.and_then(|v| Some(v.collect::<Vec<&str>>()))
.unwrap_or(vec![]);
let producer_configs = matches
.values_of("producer_configs")
.context("producer configs")?
.collect::<Vec<&str>>();
.and_then(|v| Some(v.collect::<Vec<&str>>()))
.unwrap_or(vec![]);
let consumer: BaseConsumer<ConsumerCallbackLogger> = kafka::create_client(
bootstrap_servers,
......
......@@ -70,8 +70,8 @@ fn main() -> Result<()> {
let input_file = matches.value_of("INPUT").unwrap();
let producer_configs = matches
.values_of("producer_configs")
.context("producer configs")?
.collect::<Vec<&str>>();
.and_then(|v| Some(v.collect::<Vec<&str>>()))
.unwrap_or(vec![]);
let producer: ThreadedProducer<ProducerCallbackLogger> = kafka::create_client(
bootstrap_servers,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment