Skip to content

A simple webserver built with Rocket and Tera templates that produces Kafka messages

Notifications You must be signed in to change notification settings

pablomarti/rust_webserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Webserver

This is a simple webserver built with Rocket and Tera. For the serializers it works with Serde. For more details look at Cargo.

For this test project it produces messages to a Kafka topic, it works with rdkafka.

Run the server

First setup a Kafka broker and create a topic. Then update this project to match the host and the topic (I still need to create a conf file). You can update the topic in the main.rs in L34, and the host in producer.rs in L8.

Then run the project with cargo run and access to http://127.0.0.1:8000. Submit the form and see the messages that you receive in the Kafka topic, it will produce the messages as JSON Strings. For now the Kafka key is hardcoded to event1, this is in my TODO.

About

A simple webserver built with Rocket and Tera templates that produces Kafka messages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages