RabbitMQ-to-Http bridge.
It listens to a RabbitMQ bus, and forwards messages as HTTP Requests.
Create a Config.pm, see the sample file for details. Then run:
# or just copy the sample with: cp Config.pm{.sample,}
./ratoh Config.pmAnd wait for the requests in your HTTP server ✨
Have a RabbitMQ server available, if not, here's a container to the rescue:
docker run --rm -it -p 5672:5672 rabbitmq:3
It'll have by default the following exchanges:
amq.fanout fanout
amq.topic topic
amq.direct direct
Adjust your Config.pm to use the exchange of your choice, this project was
born out of listening to topic exchanges.
Alongisde the project is also provided devel_server.pl, a mojolicious minimal
HTTP echo server. That coincidentally just works with the sample endpoints
config.
# Start the server at 127.0.0.1:3000
perl devel_server.pl daemonNow with all services up, send messages with the producer.pl:
bash producer.pl
- Perl >= v5.26
- Mojolicious, specifically
Mojo::Base,Mojo::UserAgent,Mojo::URL,Mojo::Log,Mojo::JSON&Mojo::Util Net::AMQP::RabbitMQ
Ratoh is similar "Ratón" (🐭) or "Rato" (undefined timespan between 2 minutes and 3 weeks in latin america).