This repo contains an example of how to use Benthos as an http -> Kafka
server.
Warning: this application is not production ready.
The application exposes an endpoint that publishes a message to Kafka containing the payload of the incoming JWT Bearer token.
-
Spin up containers:
$ docker-compose up
-
Start consuming messages:
$ kcat -C -b localhost:29092 -t users
. (Requires kcat). -
Send requests:
curl -v --request POST \
--url http://127.0.0.1:4195/post \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
# No Authorization header should return bad request
curl -v --request POST \
--url http://127.0.0.1:4195/post
- Adjust Kafka batching config
- Error handling for Kafka publishing