https://github.com/ignytis/send2kafka
A HTTP interface for sending messages to Kafka
https://github.com/ignytis/send2kafka
actix kafka kafka-producer librdkafka rust rust-server
Last synced: about 1 month ago
JSON representation
A HTTP interface for sending messages to Kafka
- Host: GitHub
- URL: https://github.com/ignytis/send2kafka
- Owner: ignytis
- License: gpl-3.0
- Created: 2024-01-03T22:45:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-10T19:22:32.000Z (about 1 year ago)
- Last Synced: 2024-04-11T02:11:58.692Z (about 1 year ago)
- Topics: actix, kafka, kafka-producer, librdkafka, rust, rust-server
- Language: Rust
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# send2kafka
Status: WIP
## Configuration
### General
Config could be provided in two ways:
- Environment variables e.g. `SEND2KAFKA__HTTP__HOST=localhost`
- YAML file, see the example in the next section
- By default: a `config.yaml` file in current working directory
- Could be overridden using `SEND2KAFKA__CONFIG` environment variable_NB: for Kafka attributes you need to use single `_` instead of `.`: `SEND2KAFKA__KAFKA__BOOTSTRAP_SERVERS=localhost:1234`.
Single underscores will be replaced with dots automatically.
The configuration library uses dots as separators which conflicts with Kafka property format.
In addition, environment variable names are not supposed to have dots._### Parameters
There are default values provided in the snippet below:
```yaml
http:
host: 0.0.0.0
port: 8080
# num_workers: 0 # Optional. If not specified, it will be calculated automatically: https://actix.rs/docs/server/#multi-threading
kafka:
bootstrap_servers: localhost:9092
# Here you can provide additional Kafka parameters, for example:
# sasl_mechanism: SCRAM-SHA-256
# security_protocol: SASL_PLAINTEXT
# sasl_username: me
# sasl_password: mypassword
```## API
### POST /topics/
Sends a message to Kafka topic. Message payload should be provided as a message body.
The message key could be specified using the optional _X-Key_ HTTP header