Code Monkey home page Code Monkey logo

spring-cloud-stream-binder-kafka-example's Introduction

spring-cloud-stream-binder-kafka-example

See linked project zerocode-kafka-database

Kafka quick tutorial

Download and install Kafka

# Start the ZooKeeper service
$ bin/zookeeper-server-start.sh config/zookeeper.properties

# Start the Kafka broker service
$ bin/kafka-server-start.sh config/server.properties

# To test Kafka, just create topic
bin/kafka-topics.sh --create --topic credit_rating --bootstrap-server localhost:9092
# If you got TimeOutException, 
# 1. kill running java-process Kafka 
# 2. or change ports in:
# config/zookeeper.properties property clientPort=2181
# config/server.properties property zookeeper.connect=localhost:2181
# config/server.properties property listeners=PLAINTEXT://localhost:9092

# List kafka topics
bin/kafka-topics.sh --list --zookeeper localhost:2181
# or
bin/kafka-topics.sh --list --bootstrap-server localhost:9092

# Stop the Kafka broker or ZooKeeper with Ctrl-C

# If you also want to delete any data of your local Kafka environment including any events you have created along the way, run the command:
rm -rf /tmp/kafka-logs /tmp/zookeeper

Read the events from Kafka topic

$ bin/kafka-console-consumer.sh --topic credit_rating --from-beginning --bootstrap-server localhost:9092

Alternatives, Offset Explorer (formerly Kafka Tool) and Kafkalytic - IntelliJ IDEs Plugin


Documentation:

  1. Spring Cloud Stream Binder Kafka on GitHub
  2. Spring Cloud Stream Reference Documentation

Kafka SSL configuration in config/server.properties

listeners=PLAINTEXT://localhost:9092,SSL://localhost:9093

# path to truststore
ssl.truststore.location=/Users/sample/your-path/truststore.jks
# truststore password
ssl.truststore.password=sample                                                          
ssl.truststore.type=JKS

# path to keystore
ssl.keystore.location=/Users/sample/your-path/keystore.jks
# keystore password
ssl.keystore.password=sample                                                            
ssl.key.password=sample                                                                 
ssl.keystore.type=JKS

# The list of protocols enabled for SSL connections.
ssl.enabled.protocols=TLSv1.3,TLSv1.2,TLSv1.1,TLSv1
# To enable the broker to authenticate clients (2-way authentication), 
# you must configure all the brokers for client authentication. 
# Configure this to use required rather than requested 
# because misconfigured clients can still connect successfully and this provides a false sense of security.
ssl.client.auth=required
# If you want to enable SSL for inter-broker communication, 
# add the following to the broker properties file, which defaults to PLAINTEXT:
security.inter.broker.protocol=PLAINTEXT                                                

spring-cloud-stream-binder-kafka-example's People

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.