Skip to content

Commit

Permalink
Confluent containers (#15)
Browse files Browse the repository at this point in the history
* Use confluent containers

* Minor changes

* Use last version
  • Loading branch information
rogervinas committed Jun 19, 2024
1 parent 98e8270 commit 6fec13d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
35 changes: 18 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ version: "3"

services:

kafka:
image: wurstmeister/kafka:2.12-2.5.0
environment:
- KAFKA_ADVERTISED_LISTENERS=INSIDE://:9092,OUTSIDE://localhost:9094
- KAFKA_LISTENERS=INSIDE://:9092,OUTSIDE://:9094
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME=INSIDE
- KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
- KAFKA_BROKER_ID=0
- KAFKA_AUTO_LEADER_REBALANCE_ENABLE=false
- KAFKA_CREATE_TOPICS=pub.user.token:3:1,pub.user.state:3:1
zookeeper:
image: confluentinc/cp-zookeeper:7.6.1
ports:
- "9094:9094"
links:
- zookeeper
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000

zookeeper:
image: wurstmeister/zookeeper:3.4.6
kafka:
image: confluentinc/cp-kafka:7.6.1
depends_on:
- zookeeper
ports:
- "2181"
- "9094:9094"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka:29094,LISTENER_DOCKER_EXTERNAL://localhost:9094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class DockerComposeContainerHelper {
KAFKA_PORT,
WaitAllStrategy(WITH_INDIVIDUAL_TIMEOUTS_ONLY)
.withStrategy(forListeningPort())
.withStrategy(forLogMessage(".*creating topics.*", 1))
.withStrategy(forLogMessage(".*started.*", 1))
)
.withExposedService(
ZOOKEEPER,
ZOOKEEPER_PORT,
WaitAllStrategy(WITH_INDIVIDUAL_TIMEOUTS_ONLY)
.withStrategy(forListeningPort())
.withStrategy(forLogMessage(".*binding to port.*", 1))
.withStrategy(forLogMessage(".*Started.*", 1))
)

}
Expand Down

0 comments on commit 6fec13d

Please sign in to comment.