Forum Discussion

dvictor's avatar
Occasional Contributor
4 years ago

Properties props = new Properties staying null in groovy script

I'm trying to connect to KAFKA via groovy and use a widely popular script However, props is continuously returning null. I have tried both props.setProperty and props.put alike. Neither works, and props stays null of size 0. Script is below:


Properties props = new Properties();
props.setProperty("bootstrap.servers", "localhost:9092")
props.setProperty("", "test")
props.put("", "true");
props.put("", "1000");
KafkaConsumer<String, String> consumer = new KafkaConsumer<String, String>(props);

2 Replies