-
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.
feat : Using SB AutoConfiguration, enable observability and documenta…
…tion
- Loading branch information
1 parent
aee7131
commit 418c44f
Showing
12 changed files
with
132 additions
and
122 deletions.
There are no files selected for viewing
141 changes: 77 additions & 64 deletions
141
kafka-sample/spring-modulith-outbox-pattern/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 |
---|---|---|
@@ -1,65 +1,78 @@ | ||
version: '3.8' | ||
services: | ||
|
||
postgresql: | ||
image: postgres:16.1-alpine | ||
environment: | ||
- POSTGRES_USER=appuser | ||
- POSTGRES_PASSWORD=secret | ||
- POSTGRES_DB=appdb | ||
ports: | ||
- "5432:5432" | ||
|
||
pgadmin4: | ||
container_name: pgadmin4 | ||
image: dpage/pgadmin4 | ||
extra_hosts: [ 'host.docker.internal:host-gateway' ] | ||
environment: | ||
- PGADMIN_DEFAULT_EMAIL=ap | ||
- PGADMIN_DEFAULT_PASSWORD=admin | ||
ports: | ||
- "5050:80" | ||
depends_on: | ||
- postgresql | ||
restart: unless-stopped | ||
|
||
broker: | ||
image: confluentinc/cp-kafka:7.5.3 | ||
hostname: broker | ||
ports: | ||
- "9092:9092" | ||
healthcheck: | ||
test: [ "CMD-SHELL", "nc -z localhost 9092" ] | ||
interval: 30s | ||
timeout: 5s | ||
retries: 3 | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT | ||
#Use two listeners with different names, it will force Kafka to communicate with itself via internal | ||
#listener when KAFKA_INTER_BROKER_LISTENER_NAME is set, otherwise Kafka will try to use the advertised listener | ||
KAFKA_LISTENERS: INTERNAL://broker:29092,EXTERNAL_HOST://0.0.0.0:9092,CONTROLLER://broker:9094 | ||
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker:29092,EXTERNAL_HOST://localhost:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 32 | ||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_PROCESS_ROLES: broker,controller | ||
KAFKA_NODE_ID: 1 | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@broker:9094 | ||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER | ||
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | ||
KAFKA_LOG_FLUSH_INTERVAL_MESSAGES: 9223372036854775807 | ||
CLUSTER_ID: 4L6g3nShT-eMCtK--X86sw | ||
|
||
kafdrop: | ||
image: obsidiandynamics/kafdrop | ||
restart: "no" | ||
ports: | ||
- "9000:9000" | ||
environment: | ||
KAFKA_BROKERCONNECT: "broker:29092" | ||
depends_on: | ||
broker: | ||
version: '3.8' | ||
services: | ||
|
||
postgresql: | ||
image: postgres:16.1-alpine | ||
environment: | ||
- POSTGRES_USER=appuser | ||
- POSTGRES_PASSWORD=secret | ||
- POSTGRES_DB=appdb | ||
ports: | ||
- "5432:5432" | ||
|
||
pgadmin4: | ||
container_name: pgadmin4 | ||
image: dpage/pgadmin4 | ||
extra_hosts: [ 'host.docker.internal:host-gateway' ] | ||
environment: | ||
- [email protected] | ||
- PGADMIN_DEFAULT_PASSWORD=admin | ||
ports: | ||
- "5050:80" | ||
depends_on: | ||
- postgresql | ||
restart: unless-stopped | ||
|
||
zipkin-server: | ||
image: openzipkin/zipkin | ||
container_name: zipkin-server | ||
extra_hosts: [ 'host.docker.internal:host-gateway' ] | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 512m | ||
expose: | ||
- "9411" | ||
ports: | ||
- "9411:9411" | ||
|
||
broker: | ||
image: confluentinc/cp-kafka:7.5.3 | ||
hostname: broker | ||
ports: | ||
- "9092:9092" | ||
healthcheck: | ||
test: [ "CMD-SHELL", "nc -z localhost 9092" ] | ||
interval: 30s | ||
timeout: 5s | ||
retries: 3 | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT | ||
#Use two listeners with different names, it will force Kafka to communicate with itself via internal | ||
#listener when KAFKA_INTER_BROKER_LISTENER_NAME is set, otherwise Kafka will try to use the advertised listener | ||
KAFKA_LISTENERS: INTERNAL://broker:29092,EXTERNAL_HOST://0.0.0.0:9092,CONTROLLER://broker:9094 | ||
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker:29092,EXTERNAL_HOST://localhost:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 32 | ||
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 | ||
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 | ||
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 | ||
KAFKA_PROCESS_ROLES: broker,controller | ||
KAFKA_NODE_ID: 1 | ||
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@broker:9094 | ||
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER | ||
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | ||
KAFKA_LOG_FLUSH_INTERVAL_MESSAGES: 9223372036854775807 | ||
CLUSTER_ID: 4L6g3nShT-eMCtK--X86sw | ||
|
||
kafdrop: | ||
image: obsidiandynamics/kafdrop | ||
restart: "no" | ||
ports: | ||
- "9000:9000" | ||
environment: | ||
KAFKA_BROKERCONNECT: "broker:29092" | ||
depends_on: | ||
broker: | ||
condition: service_healthy |
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
11 changes: 11 additions & 0 deletions
11
kafka-sample/spring-modulith-outbox-pattern/src/main/asciidoc/index.adoc
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,11 @@ | ||
= Spring Modulith Outbox pattern | ||
:modulith-docs: ../../../target/spring-modulith-docs | ||
|
||
== Overview | ||
|
||
plantuml::{modulith-docs}/components.puml[format="svg"] | ||
|
||
== Orders | ||
|
||
plantuml::{modulith-docs}/module-order.puml[format="svg"] | ||
include::{modulith-docs}/module-order.adoc[] |
41 changes: 0 additions & 41 deletions
41
...-pattern/src/main/java/com/example/outboxpattern/config/ExternalizationConfiguration.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...utboxpattern/config/logging/Loggable.java → ...xample/outboxpattern/config/Loggable.java
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
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
2 changes: 2 additions & 0 deletions
2
...th-outbox-pattern/src/main/java/com/example/outboxpattern/order/internal/OrderMapper.java
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
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
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