Skip to content

Commit

Permalink
Change port number
Browse files Browse the repository at this point in the history
  • Loading branch information
pataruco committed Dec 21, 2023
1 parent e195f2c commit b8e294a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
35 changes: 22 additions & 13 deletions rust-containers-k8s/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'

services:
postgres:
image: postgres:16.1
image: postgres:15.5
restart: always
volumes:
- .//database/docker-postgresql-multiple-databases:/docker-entrypoint-initdb.d
Expand All @@ -12,17 +12,26 @@ services:
POSTGRES_PASSWORD: commerce
ports:
- 5432:5432
kafka:
image: bitnami/kafka
restart: always
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
container_name: zookeeper
environment:
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
broker:
image: confluentinc/cp-kafka:7.3.0
container_name: broker
ports:
- 9092:9092
- 9093:9093
- 29092:29092
# To learn about configuring Kafka for access across networks see
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
- '9092:9092'
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
2 changes: 1 addition & 1 deletion rust-containers-k8s/notification-service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rdkafka::{
async fn main() -> anyhow::Result<()> {
println!("Notification service started");

let consumer = create_consumer("localhost:9092")?;
let consumer = create_consumer("localhost:29092")?;

consumer.subscribe(&["OrderPlacedEvent"])?;

Expand Down

0 comments on commit b8e294a

Please sign in to comment.