RabbitMQ consumer in Go for urbanstore
10K+
The purpose is to subscribe to RabbitMQ and receive messages from there.
This consumer lets us bind to a specific routingKey and get messages only for that routing key.
This image is builded with docker, so we can run tasks in other containers with exported - /var/run/docker.sock:/var/run/docker.sock:z
amqp://username:password@hostname:port/main_exchange)php)path to php cli app)action argument of php cli app)http://hostname:portI based the consumer and developed the producer according to this tutorial.
I, as the tutorial says, made it possible to subscribe only to a subset of the messages. For example, now we can direct log messages to the log file or ElasticSearch, send e-mails, and add notifications through different rabbit queues, which is also helpful in the long run, as it maintains a level of asynchronous behaviour.
Here is a schema how the provider-queue-consumer should work:

Content type
Image
Digest
Size
476.5 MB
Last updated
about 7 years ago
docker pull urbanstore/goconsumer