#1 Initial commit
Merged 4 years ago by humaton. Opened 4 years ago by mohanboddu.
releng/ mohanboddu/fmc master  into  master

@@ -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)

Listens to signed builds messages

Signed-off-by: Mohan Boddu mboddu@bhujji.com

rebased onto d3d3cdf

4 years ago

Pull-Request has been merged by humaton

4 years ago
Metadata