Giter VIP home page Giter VIP logo

kafka-impl's Introduction

Spring Web application interacting with KAFKA

This is an implementation of a spring web mvc app that produces, consumes and streams simple Kafka Messages, when SSL authentication is involved.

Also, containers were added since in today's world almost everything lives in containers. So, a Dockerfile with security and following docker best practises for java applications, is provided.

Environments

There are 3 environments available, to test the connectivity of spring application with kafka:

  1. Local (is now done using integration junit tests)
  2. Docker-compose
  3. Kubernetes with Helm (not tested yet)

Local

In order to test the functionality locally, integration unit tests are provided, using JUnit. They can be found in KafkaServiceIntegrationTest Note that the kafka cluster has to be set up manually. One easy way to do it is by using docker-compose, without the kafka-producer service. Or else, the user can manually set it up.

Docker-compose

Docker-compose is set up, to make life easier. It provides a working cluster of 3 zookeepers and 2 kafka brokers. The service is also set to use the brokers from docker-compose. Note: The test kafka certs are copied in the docker filesystem using docker-compose configuration, rather than doing it in Dockerfile

./gradlew clean build -x test
docker-compose up --build

K8s with Helm

For K8s environments, we use minikube setup to test. Also, a custom helm-plugin that provides templates needed. In build.gradle you can find tasks to publish the images to a docker repo, so that are available for k8s to download. You need to configure your own repo, so that you have access. Also, tasks to interact with k8s using Helm. You can find more info regarding using minikube with helm and how to deploy the current services in the guide provided.

API

List of requests to use for testing (can be simply used on browsers or any rest-client):

http://localhost:8080/kafka/kafka-producer/produce-messages
http://localhost:8080/kafka/kafka-consumer/consume-messages
http://localhost:8080/kafka/kafka-stream/process-messages
http://localhost:8080/kafka/kafka-consumer/consume-streamed-messages

kafka-impl's People

Contributors

bpstelios10 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.