[with_kafka] DO NOT MERGE by fishey2 · Pull Request #39 · fishey2/java-component-template · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ dependencies {
implementation('org.springframework.boot:spring-boot-starter-validation')
implementation('org.projectlombok:lombok:1.18.12')

// For Message Queue
implementation('org.springframework.boot:spring-boot-starter-activemq')
// For Kafka
implementation('org.springframework.kafka:spring-kafka')

// For Database
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
Expand All @@ -49,6 +49,7 @@ dependencies {
testImplementation('io.rest-assured:rest-assured:4.2.0')
testImplementation('io.rest-assured:json-path:4.2.0')
testImplementation('io.rest-assured:xml-path:4.2.0')
testImplementation('org.awaitility:awaitility:3.1.6')

// Annotations
annotationProcessor('org.springframework.boot:spring-boot-configuration-processor')
Expand All @@ -75,7 +76,7 @@ tasks.withType(JavaCompile) {

configurations.all {
exclude group:'junit', module:'junit'
exclude group:'org.junit.vintage', module:'junit-vintage-engine'
exclude group: 'org.junit.vintage', module:'junit-vintage-engine'
exclude group:'org.mockito', module:'mockito-all'
exclude group:'org.slf4j', module:'slf4j-log4j12'
exclude group:'org.springframework.boot', module:'spring-boot-starter-logging'
Expand Down
24 changes: 20 additions & 4 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,27 @@ services:
- 8081:8081
depends_on:
- database
activemq:
image: rmohr/activemq:5.15.9-alpine
- kafka
links:
- kafka
- database

kafka:
image: obsidiandynamics/kafka
restart: "no"
ports:
- 61616:61616
- 8161:8161
- "2181:2181"
- "9092:9092"
environment:
KAFKA_LISTENERS: "INTERNAL://:29092,EXTERNAL://:9092"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka:29092,EXTERNAL://kafka:9092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL"
KAFKA_ZOOKEEPER_SESSION_TIMEOUT: "6000"
KAFKA_RESTART_ATTEMPTS: "10"
KAFKA_RESTART_DELAY: "5"
ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: "0"

database:
image: postgres:12
ports:
Expand Down
31 changes: 26 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
version: "3.7"
services:
activemq:
image: rmohr/activemq:5.15.9-alpine
ports:
- 61616:61616
- 8161:8161
database:
image: postgres:12
ports:
Expand All @@ -14,3 +9,29 @@ services:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: java_component

kafka:
image: obsidiandynamics/kafka
restart: "no"
ports:
- "2181:2181"
- "9092:9092"
environment:
KAFKA_LISTENERS: "INTERNAL://:29092,EXTERNAL://:9092"
KAFKA_ADVERTISED_LISTENERS: "INTERNAL://kafka:29092,EXTERNAL://localhost:9092"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: "INTERNAL"
KAFKA_ZOOKEEPER_SESSION_TIMEOUT: "6000"
KAFKA_RESTART_ATTEMPTS: "10"
KAFKA_RESTART_DELAY: "5"
ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: "0"

kafdrop:
image: obsidiandynamics/kafdrop
restart: "no"
ports:
- "9000:9000"
environment:
KAFKA_BROKERCONNECT: "kafka:29092"
JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
depends_on:
- "kafka"
Empty file added gradle/docker-compose.gradle
Empty file.
2 changes: 1 addition & 1 deletion scripts/wait-for-url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

echo "Waiting for $1"

MAX_ATTEMPTS=5
MAX_ATTEMPTS=10
CURRENT_ATTEMPT=0

# Check if the provided URL can be reached
Expand Down
27 changes: 0 additions & 27 deletions src/main/java/com/roboautomator/component/QueueConsumer.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/java/com/roboautomator/component/QueueProducer.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading