This is a simple example of how to use AMQP with CloudAMPQ using Python.
- Install the required packages:
pip install -r requirements.txt- Set the environment variables:
export CLOUDAMQP_URL=your_cloudamqp_url- Run the producer:
python producer.py- Run the consumer:
python consumer.pyThis program simulates a producer and a consumer. The producer sends a message to the queue and the consumer receives it. This is a simple example of sending and receiving messages using AMQP with CloudAMPQ. The messages are sent and received are a simulation of a temperature and humidity sensors. In a real scenario, having this data, we could store it in a database, send it to a dashboard, or even trigger an alert if the values are out of the expected range.