-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split kafka-avro to producer and consumer (#315)
* Initial commit of spliting * fixes build issue * creates pipelines * removes producer side code * configure properties at correct place * Running in saperate port to run parallely --------- Co-authored-by: Raja Dilip Kolli <[email protected]>
- Loading branch information
1 parent
c7d5004
commit b0c0a6a
Showing
27 changed files
with
1,585 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: spring-boot-kafka-avro-consumer | ||
|
||
on: | ||
push: | ||
paths: | ||
- "kafka-avro/spring-boot-kafka-avro-consumer/**" | ||
branches: [ master ] | ||
pull_request: | ||
paths: | ||
- "kafka-avro/spring-boot-kafka-avro-consumer/**" | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: "kafka-avro/spring-boot-kafka-avro-consumer" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '17' | ||
distribution: 'microsoft' | ||
cache: 'maven' | ||
- name: Build with Maven | ||
run: ./mvnw -B clean verify --file pom.xml |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
HELP.md | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/** | ||
!**/src/test/** | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
|
||
### VS Code ### | ||
.vscode/ |
Binary file added
BIN
+61.1 KB
kafka-avro/spring-boot-kafka-avro-consumer/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
kafka-avro/spring-boot-kafka-avro-consumer/.mvn/wrapper/maven-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# kafka avro | ||
|
||
|
||
Apache Kafka is an open-source stream-processing platform that is used for building real-time data pipelines and streaming apps. It is horizontally scalable, fault-tolerant, and fast. | ||
|
||
Apache Avro is a data serialization system that that provides a compact and efficient binary format for data serialization and is commonly used with Apache Kafka. It is a compact and efficient binary format that allows for the serialization of data with a schema. This means that the structure of the data can be defined, and the data can be self-describing, which can be useful when working with complex data structures. | ||
|
||
Together, Kafka and Avro can be used to create a powerful platform for building real-time data pipelines and streaming applications. Avro is often used with Kafka because it supports schema evolution, which allows for the evolution of data over time without the need to update all the systems that are consuming that data. This makes it an ideal choice for use with Kafka, where data is constantly being generated and consumed by a variety of systems. | ||
|
||
|
||
### Run locally | ||
`$ ./mvnw spring-boot:run` | ||
|
||
### Useful Links | ||
* Swagger UI: http://localhost:8080/swagger-ui.html | ||
* Actuator Endpoint: http://localhost:8080/actuator | ||
* Schema Registry : http://localhost:8081/subjects/persons-value/versions?normalize=false |
42 changes: 42 additions & 0 deletions
42
kafka-avro/spring-boot-kafka-avro-consumer/docker/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: '3.9' | ||
|
||
services: | ||
kafka: | ||
image: confluentinc/cp-kafka:7.4.0 | ||
hostname: broker | ||
container_name: broker | ||
ports: | ||
- "9092:9092" | ||
- "9101:9101" | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT' | ||
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092' | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_JMX_PORT: 9101 | ||
KAFKA_JMX_HOSTNAME: localhost | ||
KAFKA_PROCESS_ROLES: 'broker,controller' | ||
KAFKA_NODE_ID: 1 | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@broker:29093' | ||
KAFKA_LISTENERS: 'PLAINTEXT://broker:29092,CONTROLLER://broker:29093,PLAINTEXT_HOST://0.0.0.0:9092' | ||
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT' | ||
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER' | ||
KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs' | ||
KAFKA_CONTROLLER_QUORUM_MODE: 'kraft' | ||
CLUSTER_ID: '4L6g3nShT-eMCtK--X86sw' | ||
|
||
schema-registry: | ||
image: confluentinc/cp-schema-registry:7.4.0 | ||
hostname: schema-registry | ||
container_name: schema-registry | ||
depends_on: | ||
- kafka | ||
ports: | ||
- "8081:8081" | ||
environment: | ||
SCHEMA_REGISTRY_HOST_NAME: schema-registry | ||
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'broker:29092' | ||
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081 |
Oops, something went wrong.