Commits

John Mitchell committed bfa83d7

rearrange, cleanup

  • Participants
  • Parent commits f24542b

Comments (0)

Files changed (8)

 mprof
 
 ui/*
+OLD/*
+images/*
 all:
 
-
-.PHONY: test
-test:	s5demo.html
+test:	messageq.html
 
 test-fast:
 	./qecho.py beer
 	sudo rabbitmqctl list_queues
 	sudo rabbitmqctl list_bindings
 	sudo rabbitmqctl list_exchanges
+
 %.html:	%.rst
 	rst2s5 $< $@
 
+sync:
+	cp ~/Documents/messageq* .
+	rsync -av ./ inkblot:src/amqp-ex/
+	test -d /media/BLACKBERRY \
+	&& rsync -av ./ /media/BLACKBERRY/amqp-ex/
 
 # http://johnmacfarlane.net/pandoc/examples.html
 # %.html:	%.rst
+#!/usr/bin/env python
+import dbus, gobject, time
+from dbus.mainloop.glib import DBusGMainLoop
+
+def screensaver_act(sleeping):
+    print '%s sleeping: %s' % (time.time(),sleeping)
+
+dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+bus = dbus.SessionBus()
+bus.add_signal_receiver(
+    screensaver_act,
+    dbus_interface="org.gnome.ScreenSaver",
+    signal_name="ActiveChanged")
+
+loop = gobject.MainLoop()
+loop.run()

messageq.txt

--*- outline -*-
-
-* questions
-** private keys?
-
-* intro
-
-Message Queues are used for routing and storing information across
-processes on one machine or several in a LAN.  Somewhat like email.
-
-** who am I
-*** Using Python since 1995
-*** C/C++, Java, PHP
-*** graphics, metadata, pipelines
-
-* overview
-
-* why MQ
-multiple news publishers, single receiver
-decentralized service
-distributed service
-durable single app
-actor model
-
-
-* msg queueing
-message orientation, queuing, routing (including point-to-point and
-publish-and-subscribe), reliability and security.
-Messages, not connections.
-
-* comparisons
-** D-Bus
-*** program registers a service
-*** routes hardware abstraction layer (HAL) msgs
-"disable screen saver when I watch a movie"
-"switch chat status from panel applet"
-** email
-
-* AMQP: Advanced Message Queuing Protocol
-** interoperability: wire level, not just API (vs: JMS)
-** financial
-
-* model:
-** broker/server
-** connection w/ user+auth
-** channel, virtual, per-thread
-** exchange: router recv msgs. named, typed
-*** properties: passive, durable, auto-delete
-** queues: holds msgs. named, properties, no types
-** message: unnamed. Header, opaque body
-*** key, immediate
-** binding: exch->queue mapping
-*** fanout (=broadcast), direct, topic matching
-
-
-* details
-** message: header(key), body (opaque)
-** key->exchange->queue
-** ex: fanout
-** types: fanout, direct, topic, others
-** ex: direct
-** topic diagram
-** extra features: persistent, ack, auto distribute?
-
-* AMQP/1.0
-** no exchanges & bindings, => links
-** addresses are first-class entities
-** service locations in DNS
-
-
-
-
-* implementations
-** RabbitMQ
-** Apache Qpid
-
-
-
-* TODO space diagram
-
-* in practice
-** useful problems
-
-** caveats
-
-*** multiple servers: round-robin. Tricky for development.
-** changes
-** no exchanges, now "queues + links"
-** addresses now first class entry
-
-* Further 
-** RedHat
-
-** help() is really good!
-
-http://blogs.digitar.com/jjww/2009/01/rabbits-and-warrens/
-
-http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_MRG/1.0/html/Messaging_Tutorial/sect-Messaging_Tutorial-Writing_Fanout_Applications_in_Python-Running_the_Fanout_Examples.html
-
-
 
 msg = amqp.Message( ' '.join(sys.argv[1:]) )
 try:
-    chan.basic_publish(msg, exchange="myfanout", immediate=True)
+    chan.basic_publish(msg, exchange="amq.fanout")
     chan.close()
 except amqp.AMQPChannelException as exc:
     print sys.argv[0],exc[1]
 chan = conn.channel()
 
 # configure my exchange to receive 'myfanout' broadcast messages
-chan.exchange_declare('myfanout', 'fanout')
+chan.exchange_declare('amq.fanout', 'fanout')
 # declare new, private queue
 chan.queue_declare(exclusive=True)
 # route broadcast messages to it
-chan.queue_bind(queue='', exchange='myfanout')
+chan.queue_bind(queue='', exchange='amq.fanout')
 # call recv(msg) when messages arrive
 chan.basic_consume(callback=recv)
 

slides/messageq.odp

Binary file added.

slides/messageq.pdf

Binary file added.