Sign inSign up

shekeriev/rabbit-cons

By shekeriev

•Updated over 3 years ago

A sample RabbitMQ consumer, written in Python and used for demonstration purposes.

Image
0

879

shekeriev/rabbit-cons repository overview

⁠RabbitMQ Sample Consumer

⁠Description

Binds to a topic exchange and listens for messages based on a topic

⁠Available variables

VariableDescriptionDefault value
BROKERBroker to connect to (name)localhost
BROKERPORTBroker's port to use (5672)5672
EXCHANGEExchange to bind to (topic)demo
TOPICSTopics to subscribe for (topic.subtopic)#

⁠Usage

# Syntax
docker container run [-d|-it] [--name fancyname] [--net appnet] [-e VAR1=VALUE1 -e ...] shekeriev/rabbit-cons 

# Example
docker container run -d --name cons --net appnet -e BROKER=rabbitmq -e BROKERPORT=5672 -e EXCHANGE=demo -e TOPICS='demo.*' shekeriev/rabbit-cons

⁠Sample output

Here is a sample output:

 [x] (R) Consumer started. Press Ctrl+C to stop.
 [x] (R) Subscribed for # on rabbitmq:5672. Listening ...
 [x] (R) 2023-01-28 13:04:57 / 'ram.info': b'info: ram load is 34'
 [x] (R) 2023-01-28 13:05:02 / 'cpu.warn': b'warn: cpu load is 73'
 [x] (R) 2023-01-28 13:05:20 / 'cpu.warn': b'warn: cpu load is 74'

⁠Source code

The latest version of the source code can be obtained from here: https://github.com/shekeriev/do2-app-pack/tree/main/rabbit-cons⁠

Tag summary

Content type

Image

Digest

sha256:8ba6495ed…

Size

48 MB

Last updated

over 3 years ago

docker pull shekeriev/rabbit-cons