Another crazy idea -- piping ØMQ into gource!
As before, I used gravatar.com to grab
the avatar images, using the
Props to decause for the idea.
- February, 2012 - I started thinking about fedmsg.
- March, 2012 - Development gets under way.
- July, 2012 - Stuff gets working in staging.
- August-September, 2012 - The first messages hit production. We notice that some messages are getting dropped. We chalk it up to programming/configuration oversights. We are correct about that in some cases.
- October-November, 2012 - Some messages are still getting dropped. Theory develops that it is due to zeromq2's lack of TCP_KEEPALIVE. It takes time to package zeromq3 and test this, integrate it with Twisted bindings, and deploy. More message sources come online during this period. Other stuff like externally consuming messages  , datanommer  , and identica  happen too.
- January, 2013 - I enabled the TCP_KEEPALIVE bits in production at FUDCon Lawrence.
I haven't noticed any dropped messages since then: a marked improvement. However, our volume of messages is so much higher now that it is difficult to eyeball. If you notice dropped messages, please let me know in #fedora-apps on freenode.
I wrote up an example for him and turns out it was pretty simple, simple enough to warrant being added as its own new section in the docs.
The downshot here is that you don't get the configuration helpers of fedmsg.config, the message manipulation helpers of fedmsg.text and most importantly, the message validation of fedmsg.crypto. The upshot is that you get a quick connection without all those dependencies:
#!/usr/bin/env python """ You'll need to install python-zmq (pyzmq) for this one.. """ import json import pprint import zmq def listen_and_print(): # You can listen to stg at "tcp://stg.fedoraproject.org:9940" endpoint = "tcp://hub.fedoraproject.org:9940" # Set this to something like org.fedoraproject.prod.compose topic = 'org.fedoraproject.prod.' ctx = zmq.Context() s = ctx.socket(zmq.SUB) s.connect(endpoint) s.setsockopt(zmq.SUBSCRIBE, topic) poller = zmq.Poller() poller.register(s, zmq.POLLIN) while True: evts = poller.poll() # This blocks until a message arrives topic, msg = s.recv_multipart() print topic, pprint.pformat(json.loads(msg)) if __name__ == "__main__": listen_and_print()
So, my project for Fedora Infrastructure (fedmsg) connects around with zeromq. Way back in the Spring of this year, skvidal suggested that I "fuzz" it and see what happens, "fuzz" meaning try to cram random bits down its tubes.
I have a little pair of python scripts that I carry around in my ~/scratch/ dir to debug various zeromq situations. One of the scripts is topics_pub.py; it binds to an endpoint and publishes messages on topics. The other is topics_sub.py which connects to an endpoint and prints messages it receives to stdout.
To fuzz the subscriber, I had it connect to a garbage source built with /dev/random and netcat. In one terminal, I ran:
$ cat /dev/random | nc -l 3005
and in the other, I ran:
$ python topics_sub.py "tcp://*:3005"
... and nothing happened.
To fuzz the publisher, I hooked /dev/random up to telnet:
$ python topics_pub.py "tcp://127.0.0.1:3005" $ cat /dev/random | telnet 127.0.0.1 3005
... and it didn't fall over. Encouraging.
I'm building a python module called fedmsg to wrap it all and it comes with a proposal-in-development. And if you're not excited yet, we've already 0mq enabled the Moksha Hub and achieved a ~100 times speedup over AMQP/qpid.
The point of this post is to ask about times for an IRC meeting of the Messaging SIG. Right now I'm thinking Tuesdays at 16:00-17:00 UTC in #fedora-meeting. If you're interested in helping with the effort but that's a bad time for you, let me know and we'll work it out.
I'll be out at PyCon until next Wednesday; so the first meeting won't be until March 20th at the earliest.