Skip to content

Commit f0464be

Browse files
committed
Kafka fixes.
1 parent e56e1bc commit f0464be

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

fastapi_template/template/{{cookiecutter.project_name}}/.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
{%- endif %}
77
{%- if cookiecutter.add_users == "True" %}
88
USERS_SECRET=""
9-
{%- endif %}
9+
{%- endif %}
10+
{%- if cookiecutter.enable_kafka == "True" %}
11+
{{cookiecutter.project_name | upper}}_KAFKA_BOOTSTRAP_SERVERS='["localhost:9094"]'
12+
{%- endif %}

fastapi_template/template/{{cookiecutter.project_name}}/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,8 @@ For running tests on your local machine.
195195
) %}
196196
1. you need to start all aux services.
197197
198-
We can do so by using our docker-compose configuration. It already has everything we need.
198+
We can do so by using our `docker-compose.yaml` configuration. It already has everything we need.
199199
200-
This section might be empty if you didn't choose any aux services in the configuration.
201200
```bash
202201
docker compose up -d --wait{%- if cookiecutter.db_info.name != 'none' %} db{%- endif %}{%- if cookiecutter.enable_redis == "True" %} redis{%- endif %}{%- if cookiecutter.enable_rmq == "True" %} rmq{%- endif %}{%- if cookiecutter.enable_kafka == "True" %} kafka{%- endif %}{%- if cookiecutter.enable_nats == "True" %} nats{%- endif %}
203202
```

fastapi_template/template/{{cookiecutter.project_name}}/docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ services:
246246
KAFKA_NODE_ID: "0"
247247
KAFKA_PROCESS_ROLES: "controller,broker"
248248
KAFKA_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094"
249-
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094"
249+
KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://{{cookiecutter.project_name}}-kafka:9092,EXTERNAL://localhost:9094"
250250
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT"
251251
KAFKA_CONTROLLER_QUORUM_VOTERS: "0@{{cookiecutter.project_name}}-kafka:9093"
252252
KAFKA_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
@@ -277,8 +277,6 @@ services:
277277
timeout: 3s
278278
retries: 20
279279
start_period: 3s
280-
ports:
281-
- 4222:4222
282280
{%- endif %}
283281

284282
{% if cookiecutter.db_info.name != 'none' %}

0 commit comments

Comments
 (0)