example
The following example will show off the usage of patron involving all components implemented.
The processing will be kicked of by sending a request to the HTTP component. The flow then will be the following:
- HTTP -> RabbitMQ publish
- RabbitMQ consumer -> kafka publish
- Kafka consumer -> log to stdout
Since tracing instrumentation is in place we can observer the flow in jaeger.
Prerequisites
setting up environment
To run the full example we need to start jaeger and prometheus. We can startup both of them using docker-compose with the following command.
docker-compose up -d
To tear down the above just:
docker-compose down
running the example
just run (within the examples folder):
go run main.go
and the use curl to send a request:
curl -i -H "Content-Type: application/json" -X POST http://localhost:50000
After that head over to jaeger and prometheus.