From the course: Complete Guide to Apache Kafka for Beginners

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

OpenSearch consumer implementation: Part 2

OpenSearch consumer implementation: Part 2 - Kafka Tutorial

From the course: Complete Guide to Apache Kafka for Beginners

OpenSearch consumer implementation: Part 2

Hi, this is Stephane from Conduktor and in this lecture, we are going to set up our Kafka consumer and improve our code. All right. So we need to create our Kafka clients and I will do this right next to the rest high level clients. Okay. So here I have a consumer, a Kafka consumer. And it's going to be consuming string string. And I'll call this one consumer. And we kind of want to have a function as well called create Kafka consumer that is going to do just that. Okay. To externalize and to keep our code a little bit clean. So let's go ahead and create that function. So I'm going to go right here and click and create a private static function which returns a Kafka consumer that I need. So I'm going to copy this and paste it here. And it takes no arguments will keep it very simple. Okay. So what we need to do is to set up a few things for our Kafka consumer, but thankfully we already have that. So if you go to Kafka basics and then source, main, Java and then consumer demo. And we…

Contents