A POC code repository to show an event flowing from
- Kafka
- Broadway
- Elixir Pubsub
- Live View
Get the latest version of Kafka
Start the server
$ bin/zookeeper-server-start.sh config/zookeeper.properties
$ bin/kafka-server-start.sh config/server.properties
Create a topic, if not already in place. For this demo we are using the topic "orders"
$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
Send messages to Kafka, to be picked up by Broadway, to send to Phoenix to send to FE
# Format is unique id, name, and a price. Name and price will update based on ID
# Number of messages to send
PubsubLive.Orders.simulate(100)
lib
├── pubsublive
│ ├── application.ex # Broadway Config
│ ├── my_broadway.ex # Broadway Code to accept Kafka
│ ├── orders.ex # Generate messages for Kafka
└── pubsublive_web
├── live
│ ├── ticker.ex # Ticker LiveView, most of the code is here
│ └── ticker_component.ex # Ticker Component
└── router.ex # routes added for /ticker
assets
├── css
│ └── app.css # Styling for flash on change
└── js
└── app.js # Small hook for JS/LiveView Interop to flash