Skip to content

Instantly share code, notes, and snippets.

@mchmielarz
Last active December 15, 2020 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchmielarz/237b8fc919ddb9f6d03cda379505b24e to your computer and use it in GitHub Desktop.
Save mchmielarz/237b8fc919ddb9f6d03cda379505b24e to your computer and use it in GitHub Desktop.
class KafkaVerticle extends AbstractVerticle {
// initialization
@Override
public void start() {
KafkaConsumer.create(vertx, kafkaConfig)
.subscribe(topic)
.handler(record ->
// processing logic comes here
)
.endHandler(v -> log.info("End of data. Topic: {}", this.topic))
.exceptionHandler(e -> log.error("Single Kafka consumer error", e));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment