fedmsg

Nicolas Dandrimont

olasd@debian.org

19th January 2014

Table of Contents

What is fedmsg?

Fedmsg website

A unified message bus, reducing the coupling of interdependent services

Services subscribe to one (or several) message topic(s), register callbacks, and respond to events

Bus topology

topology.png

Publishing messages

From python:

import fedmsg
fedmsg.publish(topic='testing', modname='test', msg={
    'test': "Hello World",
})

From the shell:

$ echo "Hello World." | fedmsg-logger --modname=git --topic=repo.update
$ echo '{"a": 1}' | fedmsg-logger --json-input
$ fedmsg-logger --message="This is a message."
$ fedmsg-logger --message='{"a": 1}' --json-input

Receiving messages

From python:

import fedmsg

# Read in the config from /etc/fedmsg.d/
config = fedmsg.config.load_config([], None)

for name, endpoint, topic, msg in fedmsg.tail_messages(**config):
    print topic, msg  # or use fedmsg.encoding.pretty_dumps(msg)

In the shell, you can use the fedmsg-tail command (demo time)

You will need to connect to the debian endpoint, tcp://fedmsg.debian.net:9940 in /etc/fedmsg.d/endpoints.py.

Goodies

  • A stream of data representing the infrastructure activity (stats)
  • De-coupling of interdependent services
  • Desktop notifications for devs
  • Live web dashboard of events
  • IRC feed (#debian-fedmsg @ OFTC)
  • identi.ca and twitter accounts that get banned for flooding :-)

How can I help?

Convert your services to send messages natively.

Or, point me at services that could benefit from being converted to fedmsg.

Contact info: olasd@debian.org, olasd on irc.debian.org