From d3d3cdf99a6bce06f432e84f23b429d82b8a4dd8 Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Nov 20 2019 20:24:50 +0000 Subject: Initial commit Listens to signed builds messages Signed-off-by: Mohan Boddu --- diff --git a/fedora-minimal-compose.py b/fedora-minimal-compose.py new file mode 100755 index 0000000..d447701 --- /dev/null +++ b/fedora-minimal-compose.py @@ -0,0 +1,37 @@ +#!/usr/bin/python3 + +#import fedora_messaging.api +#import json + +#while True: +# m = fedora_messaging.api.Message(topic = 'org.fedoraproject.prod.buildsys.rpm.sign') + +# print(m.topic) +# print(m.body) + +from fedora_messaging import api, config + +print(config.conf) + +class SaveMessage(object): + """ + A fedora-messaging consumer that saves the message to a file. + + A single configuration key is used from fedora-messaging's + "consumer_config" key, "path", which is where the consumer will save + the messages:: + + [consumer_config] + path = "/tmp/fedora-messaging/messages.txt" + """ + + def __call__(self, message): + """ + Invoked when a message is received by the consumer. + + Args: + message (fedora_messaging.api.Message): The message from AMQP. + """ + print(str(message)) + +api.consume(SaveMessage)