On Wed, 2020-02-26 at 13:04 -0500, Robbie Harwood wrote:
Would be nice if there were an API that would let us listen to it
without needing to write an IRC bot or loop polling an HTTP endpoint.
It sounds like this is similar to what Jeremy was proposing, but I'm not
sufficiently versed in Messaging language to know.
Maybe I'm missing something, but if you want to do that, I would think
you would want to use the *messaging system itself*, not a notification
system built on top of the messaging system which is intended
specifically for producing notifications for *humans*?
You can already work with fedora-messaging fine in production, there
are docs and examples to follow:
https://fedora-messaging.readthedocs.io/en/latest/index.html
both openqa and bodhi deploy fedora-messaging consumer and publishers
in infra; you can look at their infra roles and git repos to get a
handle on how that works. e.g. the templates for the openQA consumers
are at
https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/open...
,
other relevant bits in
https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/open...
,
https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/inventory/...
and
https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/playbooks/...
.
For an example of the actual consumer code, see
https://pagure.io/fedora-qa/fedora_openqa/blob/master/f/fedora_openqa/con... .
Deploying a consumer outside of infra mainly just involves writing
the consumer code, writing a config file like the ones in
https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/open...
or the documentation or the sample at
https://github.com/fedora-infra/fedora-messaging/blob/master/configs/fedo...
and placing it in /etc/fedora-messaging , then enabling and starting
the `fm-consumer(a)(whatever).service` service.
At present, there is two-way bridging between fedmsg and fedora-
messaging: messages published natively as fedmsgs are republished as
fedora-messaging messages, and vice versa. So you can write a fedora-
messaging-native consumer and still consume messages that are natively
published as fedmsgs (or vice versa, but don't do that, we're trying to
get people onto fedora-messaging :>)
--
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net
http://www.happyassassin.net