- Code :
dotNetcore v5.0 - linux alpine self-contained compiled
- Docker images : https://hub.docker.com/r/lefebsy/json2kafka/tags
- Memory needed : ~ 30Mo
- Designed for kubernetes, all settings can be setted by environnements variables or a configmap
appsettings.json
file - Liveness and readiness probes ready
/health
- Can publish on a Kafka with TLS and Sasl username/password
- The REST API can be exposed with a simple basicAuth login/password
- Logs
JSON formated
compliant withkubernetes annotations elastic.co
to be parsed and displayed in Kibana
- Method :
POST
- URI :
/api/msg
- Content-Type :
application/json
- Format :
UTF-8
- Body :
Json document
- [BasicAuth] :
username and password header
Example :
curl -u admin:admin -H "Content-Type: application/json" -X POST https://5001-host-xyz.gitpod.io/api/msg -d '{"key1":"value1", "key2":"value2"}'
From Gitpod terminal :
J2K_URL=$(gp url 5001)
curl -u admin:admin -H "Content-Type: application/json" -X POST $J2K_URL/api/msg -d '{"key1":"value1", "key2":"value2"}'
- kafka : read the service settings
See manifest.yml for a basic example
- There is NO authentication impersonation, REST credentials are not played as Kafka credentials
- This code is not fully tested, it is a very simple project to test Kafka in dotnetCore microservice