Skip to content

Commit

Permalink
Add instructions for developing with Kafka
Browse files Browse the repository at this point in the history
  • Loading branch information
cc-a committed Sep 11, 2024
1 parent 82914df commit 1ae36ec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,25 @@ docker compose exec app python scripts/talk_to_process_manager.py
```

Take the servers down with `docker compose down`

### Working with Kafka

Due to the complexities of containerising Kafka it is not possible to use the standard
Docker Compose setup. Instead when working with functionality that requires Kafka it is
necessary to run the individual components manually.

1. Start the drunc shell:
`poetry run drunc-unified-shell --log-level debug ./data/process-manager-pocket-kafka.json`

1. Start Kafka - See [Running drunc with pocket kafka].

1. Start the application server:
`poetry run python manage.py runserver`

1. Start the Kafka consumer:
`poetry run python scripts/kafka_consumer.py`

From here you should be able to see broadcast messages displayed at the top of the index
page on every refresh.

[Running drunc with pocket kafka]: https://github.com/DUNE-DAQ/drunc/wiki/Running-drunc-with-pocket-kafka
13 changes: 13 additions & 0 deletions data/process-manager-pocket-kafka.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "ssh",
"name": "SSHProcessManager",
"command_address": "0.0.0.0:10054",
"authoriser": {
"type": "dummy"
},
"broadcaster": {
"type": "kafka",
"kafka_address": "127.0.0.1:30092",
"publish_timeout": 2
}
}

0 comments on commit 1ae36ec

Please sign in to comment.