<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>J5's Blog &#187; tubes</title>
	<atom:link href="http://www.j5live.com/category/tubes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.j5live.com</link>
	<description>Where the urethane hits the pavement</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:05:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flattening the model</title>
		<link>http://www.j5live.com/2010/01/27/flattening-the-model/</link>
		<comments>http://www.j5live.com/2010/01/27/flattening-the-model/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:14:04 +0000</pubDate>
		<dc:creator>J5</dc:creator>
				<category><![CDATA[AMQP]]></category>
		<category><![CDATA[Open Formats]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[messaging]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[tubes]]></category>

		<guid isPermaLink="false">http://www.j5live.com/?p=714</guid>
		<description><![CDATA[In my quest for cleaner code in Kamaloka-js I have been working on simplifying the dispatch model.  AMQP has some interesting features built into it to facilitate real-time functionality along with message prioritization.  To accomplish this messages can be sent on different queues and tracks, and also be broken up into segments which can be [...]]]></description>
			<content:encoded><![CDATA[<p>In my quest for cleaner code in Kamaloka-js I have been working on simplifying the dispatch model.  AMQP has some interesting features built into it to facilitate real-time functionality along with message prioritization.  To accomplish this messages can be sent on different queues and tracks, and also be broken up into segments which can be further broken up into frames.</p>
<p><strong>Frames </strong></p>
<p>Frames are the basic building blocks of the AMQP data stream.  They contain complete headers that describe queue, track and segment that is currently being constructed.  The payload of a frame (the segment being built) can be broken up into arbitrary sized byte arrays which are then reassembled based on the channel and track they are sent on.  In this way applications with memory constraints can request that frames be no bigger than what the application can fit in memory.  A typical frame header looks something like:</p>
<p><code> </code></p>
<pre>{
  channel: 0,
  track:1,
  is_first_frame: 1,
  is_last_frame: 1,
  is_first_segment: 1,
  is_last_segment: 1
}</pre>
<p><strong>Segments</strong></p>
<p>Segments are like frames but instead of an arbitrary split on a data size, each segment is split on struct boundaries.  That is to say, when you receive a complete segment you can be sure that it can be fully parsed.  There are currently four segment types: A control segment, command segment, header segment and body segment.  Command messages are currently the only type that can contain a header and body segment. For instance, the transfer command is used to send messages to and from a queue.  It would contain header segments which could be used to route the entire message and it would contain a body segment which contains arbitrary data the user application cared about.  Each segment is broken up into at least one frame.  Multiple segments would never be sent in a single frame.</p>
<p><strong>Channel and Tracks</strong></p>
<p>A channel is just an integer that denotes related frames and segments.  One can think of each channel being a list of incoming frames which are ordered correctly.  Once the last frame in a channel is seen, the message is constructed and the channel is flushed and ready to receive a new message.  In this way, multiple messages can be received at the same time by utilizing different channels but only one message can be sent on a single channel at a time.</p>
<p>Tracks are an exception to the one message per channel rule.  There are two tracks in the current spec.  The control track (track 0) and the command track (track 1).  Controls preempt commands on a channel, so you can be in the middle of receiving frames on the command track and a control can come in on the control track and you must respond to that first.</p>
<p>This all sounds complicated but  you can just think of the channel/track combination as being one entry in an hash.  For instance frames coming into channel 0 and track 1 would be given the hash &#8220;0.1&#8243;:</p>
<p><code>message_channels["0.1"].add_frame(incoming)</code></p>
<p><strong>First pass &#8211; Frame dispatching</strong></p>
<p>At first it was easier to think of the frame and segment issues as different layers.  At the lowest layer I would decode and dispatch each frame and then pass it off to the segment layer once a complete segment had been decoded.  The segment layer would then collect the segments, relate them to each other, and then construct the full message.  The frame layer looked something like this:</p>
<div id="attachment_715" class="wp-caption aligncenter" style="width: 620px"><a href="http://www.j5live.com/wp-content/uploads/2010/01/frame_decoding_0.png"><img src="http://www.j5live.com/wp-content/uploads/2010/01/frame_decoding_0.png" alt="Flowchart showing the frame decoding layer of the kamaloka-js AMQP bindings" title="amqp frame decoding layer" width="610" height="819" class="size-full wp-image-715" /></a><p class="wp-caption-text">Flowchart showing the frame decoding layer of the kamaloka-js AMQP bindings</p></div>
<p>The dispatch would then pass it off to the segment decoder.</p>
<p>This became overly complicated because each segment had varying degrees of metadata and the body and header segments didn&#8217;t map to the message object very well.  I could have gone ahead and created a segment object but I wanted to simplify the code.</p>
<p><strong>Flattening the frame and segment layers</strong></p>
<p>As it turned out flattening the model only added a couple of more steps to the current frame layer.  Since frames and segments are just two different ways of breaking up a message for transfer over the wire, combining the two in the same layer made sense.  What I ended up with was this:</p>
<div id="attachment_717" class="wp-caption aligncenter" style="width: 631px"><a href="http://www.j5live.com/wp-content/uploads/2010/01/frame_decoding_1.png"><img src="http://www.j5live.com/wp-content/uploads/2010/01/frame_decoding_1.png" alt="Flowchart showing how the Kamaloka-js AMQP bindings decode frame and segments into a message" title="frame and segment decoding for the Kamaloka-js amqp bindings" width="621" height="971" class="size-full wp-image-717" /></a><p class="wp-caption-text">Flowchart showing how the Kamaloka-js AMQP bindings decode frame and segments into a message</p></div> 
<p>If you notice I now only create a new message if it is the first frame and first segment on a channel.  When I see it is the last frame I incrementally decode the segment but I only dispatch the message once the last segment is seen.  In the end, these minor adjustments allowed me to strip out a whole layer of redundant code.  It also simplified the low level event code as I used to have to manage callbacks for each segment in order to construct a message.  Now events only trigger once a full message is received and not  when each frame or segment is received.</p>
[read this post in: <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Car">ar</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cde">de</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Ces">es</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cfr">fr</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cit">it</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cja">ja</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cko">ko</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cpt">pt</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Cru">ru</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2010/01/27/flattening-the-model/&langpair=en%7Czh-CN">zh-CN</a> ]]]></content:encoded>
			<wfw:commentRss>http://www.j5live.com/2010/01/27/flattening-the-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FUDCon, the AMQP story</title>
		<link>http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/</link>
		<comments>http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 23:41:12 +0000</pubDate>
		<dc:creator>J5</dc:creator>
				<category><![CDATA[AMQP]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[messaging]]></category>
		<category><![CDATA[tubes]]></category>

		<guid isPermaLink="false">http://www.j5live.com/?p=691</guid>
		<description><![CDATA[With FUDCon being only two weeks away, I&#8217;ve been polishing up my presentation and looking into what is in store for the future of Fedora&#8217;s Infrastructure.  My main focus has been adding &#8220;push&#8221; capabilities throughout our infrastructure via the use of the AMQP protocol and qpid servers.
So why do we care about push messaging?
One [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="https://fedoraproject.org/wiki/FUDCon:Toronto_2009">FUDCon</a> being only two weeks away, I&#8217;ve been polishing up my presentation and looking into what is in store for the future of Fedora&#8217;s Infrastructure.  My main focus has been adding &#8220;push&#8221; capabilities throughout our infrastructure via the use of the <a href="http://amqp.org">AMQP protocol</a> and <a href="http://qpid.apache.org/">qpid</a> servers.</p>
<p><strong>So why do we care about push messaging?</strong></p>
<p>One can think of messaging as a conversation between two people.  Poll messaging goes something like this:</p>
<p><a href="http://www.j5live.com/wp-content/uploads/2009/11/push_vs_poll_comic.png"><img class="aligncenter size-full wp-image-695" title="Poll Messaging" src="http://www.j5live.com/wp-content/uploads/2009/11/push_vs_poll_comic_poll.png" alt="Poll Messaging" width="718" height="195" /></a></p>
<p>Push on the other hand is a bit less chatty:</p>
<p><a href="http://www.j5live.com/wp-content/uploads/2009/11/push_vs_poll_comic.png"><img class="aligncenter size-full wp-image-694" title="Push Messaging" src="http://www.j5live.com/wp-content/uploads/2009/11/push_vs_poll_comic_push.png" alt="Push Messaging" width="720" height="196" /></a></p>
<p>By eliminating the need to poll to know when an event has happened within Fedora&#8217;s Infrastucture, and making it easy for services to push out events in an easy fire and forget manner, we open up the door to a number of interesting possibilities.  For instance, instead of implementing mail notification functionality in every service we simply create a mail notification service that listens for events and sends e-mails to people who what them.  Do you want to get a notification on your desktop when your build is done instead?  This makes it possible to provide that functionality without bogging down the Koji build service.</p>
<p>Human consumable notifications isn&#8217;t the only advantage of adding push messaging to our infrastructure.  Because the data is first formatted for services to consume, notifications can be used for things like automation and synchronization.  For instance someone could write a script that listens for new git checkins at fedorahosted.org and tries to package it into a private repo for personal testing.</p>
<p><strong>What do we need to discuss at FUDCon?</strong></p>
<p>Though this change is minimally invasive and you can ignore it if you don&#8217;t need to work with notifications, it is never the less a large undertaking.  Some of the things we need to discuss are:</p>
<ul>
<li>Usecases &#8211; where can we benefit by adding notifications?  How do we envision the notifications will be consumed?</li>
<li>Payload format &#8211; what are the pros and cons of the different ways we can encode and decode data</li>
<li>Standardization &#8211; even though we have a routing protocol we still need to standardize on the type of data to expect</li>
<li>Libraries &#8211; we need to make it dirt easy for infrastructure developers to add notifications to their service</li>
<li>Performance and security concerns &#8211; AMQP is pretty complex so we will need to make sure all of our bases are covered when deploying the QPID servers</li>
</ul>
<p><strong>AMQP Sessions at FUDCon</strong></p>
<p>There are a couple of talks planned and a hackfest.  Come to the talks to get a deeper understanding of AMQP and how we envision using it within Fedora and then attend the hackfest to help us map out the future of the Fedora Messaging Infrastructure.</p>
<p>Saturday:</p>
<ul>
<li>AMQP Messaging for Fedora Developers &#8211; come to my session to find out the basics of AMQP messaging and how it is relevant to Fedora&#8217;s infrastructure</li>
<li>AMQP/Qpid on Fedora &#8211; The definitive guide &#8211; get a more in-depth view of AMQP in Rajith Attapattu session.  He will show you how to setup and configure the Qpid server on Fedora, use the client APIs, and where to go to find help when using AMQP.</li>
</ul>
<p>Sunday and/or Monday:</p>
<ul>
<li>Get on the (Message) BUS Hackfest! &#8211; come to Jesse Keating&#8217;s hackfest to work out details and hack on the messaging infrastructure.</li>
</ul>
[read this post in: <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Car">ar</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cde">de</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Ces">es</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cfr">fr</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cit">it</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cja">ja</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cko">ko</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cpt">pt</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Cru">ru</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/&langpair=en%7Czh-CN">zh-CN</a> ]]]></content:encoded>
			<wfw:commentRss>http://www.j5live.com/2009/11/23/fudcon-the-amqp-story/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home is where the heart is</title>
		<link>http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/</link>
		<comments>http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 01:59:24 +0000</pubDate>
		<dc:creator>J5</dc:creator>
				<category><![CDATA[Open Formats]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[messaging]]></category>
		<category><![CDATA[tubes]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://www.j5live.com/?p=626</guid>
		<description><![CDATA[I managed to make it home in one piece from Vegas and dove right back into work.  After getting away from messaging for a bit I have come full circle but with a little bit of a twist.  In an effort to bring some of the goodness that is interprocess messaging to the [...]]]></description>
			<content:encoded><![CDATA[<p>I managed to make it home in one piece from Vegas and dove right back into work.  After getting away from messaging for a bit I have come full circle but with a little bit of a twist.  In an effort to bring some of the goodness that is interprocess messaging to the interwebs &#8211; similar to what we get on the desktop with D-Bus &#8211; I am implementing the <a href="http://jira.amqp.org/confluence/display/AMQP/Advanced+Message+Queuing+Protocol">standard AMQP protocol</a> in native JavaScript.  </p>
<p>This along with <a href="http://qpid.apache.org/qmf-protocol.html">QMF</a> will give us the ability to send out notifications of events, monitor statistics and eventually supplement REST and XML-RPC interfaces with more efficient multi-response method calling (imagine streaming rows of data instead of waiting for the entire row set to be sent).</p>
<div id="attachment_627" class="wp-caption alignnone" style="width: 774px"><img src="http://www.j5live.com/wp-content/uploads/2009/08/orbited_test1.png" alt="AMQP Handshake over Orbited" title="Test of AMQP over Orbited" width="764" height="370" class="size-full wp-image-627" /><p class="wp-caption-text">AMQP Handshake over Orbited</p></div>
<p>Above is a little hex dump web app I wrote to test the bindings.  What you see is the start of the AMQP handshake.   First I send the header indicating the version of the protocol I am expecting.  I then get the &#8217;start&#8217; response back stating the capabilities of the broker I have connected to.  I then send the &#8217;start-ok&#8217; packet indicating what auth mechanisms I support and the locale (I would also send a token if I were using a particular auth other than anonymous). </p>
<p>That is about as far as I have gotten but since the bindings are autogenerated from an XML description of the protocol most of the control and command classes are implemented.  There are still some types I am trying to figure out how to support (the supported types are a magnitude above what was needed for D-Bus) and I need to smooth out the rough edges as well as write the higher level user bindings but I am off to a good start.</p>
<p>Code will be posted as soon as the project resources are approved and setup.  Keep watching my blog for updates.</p>
<p><strong>BTW</strong>: The slow response times in the time stamps are due to running inside of the firebug debugger and writing out the hex dumps on the fly using JQuery.  It seems the more sophisticated JQuery and Firebug get, the more they butt heads. </p>
[read this post in: <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Car">ar</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cde">de</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Ces">es</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cfr">fr</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cit">it</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cja">ja</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cko">ko</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cpt">pt</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Cru">ru</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/&langpair=en%7Czh-CN">zh-CN</a> ]]]></content:encoded>
			<wfw:commentRss>http://www.j5live.com/2009/08/26/home-is-where-the-heart-is/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We&#8217;ve got TUBES!!!</title>
		<link>http://www.j5live.com/2007/05/17/weve-got-tubes/</link>
		<comments>http://www.j5live.com/2007/05/17/weve-got-tubes/#comments</comments>
		<pubDate>Thu, 17 May 2007 19:49:12 +0000</pubDate>
		<dc:creator>J5</dc:creator>
				<category><![CDATA[D-Bus]]></category>
		<category><![CDATA[OLPC]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[developing nations]]></category>
		<category><![CDATA[tubes]]></category>

		<guid isPermaLink="false">http://www.j5live.com/?p=371</guid>
		<description><![CDATA[Daf talked about it, Robert McQueen followed up on it.  Perhaps Senator Ted Stevens wasn&#8217;t so wrong after all.

TUBES the video!!!
Our latest Sugar builds now have Collabora&#8217;s excellent work on TUBES!!!  I just got off an Internet video chat between myself and demo Walter Bender is doing down in Argentina.  Sound was [...]]]></description>
			<content:encoded><![CDATA[<p>Daf <a href="http://dgh.livejournal.com/3997.html">talked about it</a>, Robert McQueen <a href="http://www.robot101.net/2007/05/11/tubes-and-planets/">followed up on it</a>.  Perhaps <a href="http://stevens.senate.gov/public/">Senator Ted Stevens</a> wasn&#8217;t so wrong after all.</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/EtOoQFa5ug8"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/EtOoQFa5ug8" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object><br />
<a href="http://www.youtube.com/watch?v=EtOoQFa5ug8">TUBES the video!!!</a></p>
<p></object>Our latest Sugar builds now have <a href="http://www.collabora.co.uk/">Collabora&#8217;s</a> excellent work on TUBES!!!  I just got off an Internet video chat between myself and demo Walter Bender is doing down in Argentina.  Sound was amazing.  We also have a Connect 4 activity,  and shared PDF activity going.  Eric Blankinship is on the verge of tubafying his excellent Capture activity so kids can share photos and videos over TUBES and we have some guys tubafying a drum circle activity.  I should be getting to Block Party soon and releasing a bunch of tutorials in the process.</p>
<p>So we belatedly proved the Senator correct.  The Internet is now made up of a bunch of Tubes.  There is still one thing he got wrong though.  I hereby state that D-Tubes, which is D-Bus messages over Tubes, can also be called Big Truck.  So now the Internet can be a Big Truck which drives over TUBES!!!!</p>
[read this post in: <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Car">ar</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cde">de</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Ces">es</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cfr">fr</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cit">it</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cja">ja</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cko">ko</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cpt">pt</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Cru">ru</a> <a href="http://translate.google.com/translate?u=http://www.j5live.com/2007/05/17/weve-got-tubes/&langpair=en%7Czh-CN">zh-CN</a> ]]]></content:encoded>
			<wfw:commentRss>http://www.j5live.com/2007/05/17/weve-got-tubes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

