How to consume fedora-messaging?


I have been trying to write some script which would listen on
generation of new repository / successful build is tagged in Koji and
do some actions locally. Or basically whenever someone pushes commits,
I want to fetch repo locally.

I was reading <a href="" title=""></a>,
but it is not very clear to me where I can find list of topics and
what data messages will contain...

Bonus point who can tell me how does it know which messages should be
re-queued and how to manipulate that.