Skip to content

Commit

Permalink
replace kafka-console-consumer with mill util (#478)
Browse files Browse the repository at this point in the history
Co-authored-by: Kiryl Matsenka <[email protected]>
Co-authored-by: Miłosz Smółka <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent 8df333b commit efb5340
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions _examples/basic/1-your-first-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ server_1 | 2019/08/29 19:41:29 received event {ID:9}
Open another terminal and take a look at Kafka topics to see that all messages are there. The initial events should be present on the `events` topic:

```bash
> docker-compose exec kafka kafka-console-consumer --bootstrap-server localhost:9092 --topic events
> docker-compose exec server mill kafka consume -b kafka:9092 --topic events

{"id":12}
{"id":13}
Expand All @@ -51,7 +51,7 @@ Open another terminal and take a look at Kafka topics to see that all messages a
And the processed messages will be stored in the `events-processed` topic:

```bash
> docker-compose exec kafka kafka-console-consumer --bootstrap-server localhost:9092 --topic events-processed
> docker-compose exec server mill kafka consume -b kafka:9092 -t events-processed

{"processed_id":21,"time":"2019-08-29T19:42:31.4464598Z"}
{"processed_id":22,"time":"2019-08-29T19:42:32.4501767Z"}
Expand Down
4 changes: 3 additions & 1 deletion _examples/basic/1-your-first-app/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ services:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
working_dir: /app
command: go run main.go
command: >
/bin/sh -c "go install github.com/ThreeDotsLabs/watermill/tools/mill@latest &&
go run main.go"
kafka:
image: bitnami/kafka:3.5.0
Expand Down
2 changes: 1 addition & 1 deletion _examples/basic/2-realtime-feed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ You should see the live feed of posts on the standard output.
1. Peek into the posts counter published on `posts_count` topic.

```
docker-compose exec kafka kafka-console-consumer --bootstrap-server localhost:9092 --topic posts_count
docker-compose exec consumer mill kafka consume -b kafka:9092 -t posts_count
```

2. Add a persistent storage for incoming posts in the consumer service, instead of displaying them.
Expand Down
4 changes: 3 additions & 1 deletion _examples/basic/2-realtime-feed/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ services:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
working_dir: /app/consumer/
command: go run main.go
command: >
/bin/sh -c "go install github.com/ThreeDotsLabs/watermill/tools/mill@latest &&
go run main.go"
zookeeper:
image: confluentinc/cp-zookeeper:7.3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ Observe the log output. You will notice new events, generated by the example.
In another terminal, run the following command to consume events produced on the Kafka topic.

```bash
docker-compose exec kafka kafka-console-consumer --bootstrap-server kafka:9092 --topic events
docker-compose exec server mill kafka consume -b kafka:9092 -t events
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ services:
- .:/app
- $GOPATH/pkg/mod:/go/pkg/mod
working_dir: /app
command: go run main.go
command: >
/bin/sh -c "go install github.com/ThreeDotsLabs/watermill/tools/mill@latest &&
go run main.go"
mysql:
image: mysql:8.0
Expand Down

0 comments on commit efb5340

Please sign in to comment.