<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Of Bunny and AMQP</title>
	<atom:link href="http://bunnyamqp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bunnyamqp.wordpress.com</link>
	<description>talking about AMQP and the Bunny Ruby AMQP client</description>
	<lastBuildDate>Tue, 06 Dec 2011 09:55:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bunnyamqp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Of Bunny and AMQP</title>
		<link>http://bunnyamqp.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bunnyamqp.wordpress.com/osd.xml" title="Of Bunny and AMQP" />
	<atom:link rel='hub' href='http://bunnyamqp.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Bunny: v0.7.2 Release</title>
		<link>http://bunnyamqp.wordpress.com/2011/07/25/bunny-v0-7-2-release/</link>
		<comments>http://bunnyamqp.wordpress.com/2011/07/25/bunny-v0-7-2-release/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 19:46:16 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[0.7.2]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=123</guid>
		<description><![CDATA[Bunny v0.7.2 is now available from GitHub. This point release fixes an issue with irb auto-completion (See this post for details). Filed under: Bunny, Releases Tagged: 0.7.2, Bunny, release<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=123&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Bunny v0.7.2 is now available from <a href="http://github.com/ruby-amqp/bunny">GitHub</a>. This point release fixes an issue with irb auto-completion (See <a href="http://wp.me/pC0Ym-H">this post</a> for details).</p>
<br />Filed under: <a href='http://bunnyamqp.wordpress.com/category/bunny/'>Bunny</a>, <a href='http://bunnyamqp.wordpress.com/category/releases/'>Releases</a> Tagged: <a href='http://bunnyamqp.wordpress.com/tag/0-7-2/'>0.7.2</a>, <a href='http://bunnyamqp.wordpress.com/tag/bunny/'>Bunny</a>, <a href='http://bunnyamqp.wordpress.com/tag/release/'>release</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=123&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2011/07/25/bunny-v0-7-2-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: v0.7.1 Release</title>
		<link>http://bunnyamqp.wordpress.com/2011/07/21/bunny-v0-7-1-release/</link>
		<comments>http://bunnyamqp.wordpress.com/2011/07/21/bunny-v0-7-1-release/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 08:12:12 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[0.7.1]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=119</guid>
		<description><![CDATA[Bunny v0.7.1 is now available from GitHub. It contains a number of minor changes. Perhaps the most notable change is a deprecation message that is output to the console when the Queue#publish method is used. The Queue#publish method is a convenience method that enables messages to be routed to a queue via the default direct [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=119&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Bunny v0.7.1 is now available from <a href="http://github.com/ruby-amqp/bunny">GitHub</a>. It contains a number of minor changes. Perhaps the most notable change is a deprecation message that is output to the console when the Queue#publish method is used.</p>
<p>The Queue#publish method is a convenience method that enables messages to be routed to a queue via the default direct exchange which has an empty string (&#8220;&#8221;) as its name. Apparently, this method has lead developers to mistakenly believe that messages are directly delivered to queues. This is most certainly <strong>not the case</strong> (Please see this <a href="http://rdoc.info/github/ruby-amqp/amqp/master/file/docs/Exchanges.textile">documentation</a> for an explanation).</p>
<p>Therefore, in order to avoid this confusion it has been decided to deprecate the Queue#publish method. If you find the method useful and would not like to see it deprecated, please raise the issue on <a href="http://github.com/ruby-amqp/bunny">GitHub</a> or in the <a href="http://groups.google.com/group/ruby-amqp">ruby-amqp Google Group</a>.</p>
<br />Filed under: <a href='http://bunnyamqp.wordpress.com/category/bunny/'>Bunny</a>, <a href='http://bunnyamqp.wordpress.com/category/releases/'>Releases</a> Tagged: <a href='http://bunnyamqp.wordpress.com/tag/0-7-1/'>0.7.1</a>, <a href='http://bunnyamqp.wordpress.com/tag/bunny/'>Bunny</a>, <a href='http://bunnyamqp.wordpress.com/tag/release/'>release</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=119&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2011/07/21/bunny-v0-7-1-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: Under new management</title>
		<link>http://bunnyamqp.wordpress.com/2011/06/30/bunny-under-new-management/</link>
		<comments>http://bunnyamqp.wordpress.com/2011/06/30/bunny-under-new-management/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 08:30:24 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=109</guid>
		<description><![CDATA[For some time now I&#8217;ve been unable to devote as much time as is necessary to maintain Bunny. As luck would have it, Jakub Stastny contacted me a while ago with a view to reviving Bunny. Since then Jakub and Michael Klishin have been doing a marvellous job of creating, improving and maintaining the bedrock [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=109&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For some time now I&#8217;ve been unable to devote as much time as is necessary to maintain <a href="http://github.com/ruby-amqp/bunny">Bunny</a>. As luck would have it, <a href="http://github.com/botanicus">Jakub Stastny</a> contacted me a while ago with a view to reviving Bunny. Since then Jakub and <a href="http://github.com/michaelklishin">Michael Klishin</a> have been doing a marvellous job of creating, improving and maintaining the bedrock which both Bunny and the <a href="http://github.com/ruby-amqp/amqp">amqp</a> Ruby gems can be supported by. The amqp gem has already undergone extensive surgery and it looks like Bunny is due for some more attention shortly.</p>
<p>I am pleased to see that Bunny is in good hands and I look forward to the improvements to come.  Many thanks to Jakub, Michael and all of the contributors to the Bunny gem. Open Source is a wonderful thing and long may it continue. </p>
<br />Filed under: <a href='http://bunnyamqp.wordpress.com/category/bunny/'>Bunny</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=109&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2011/06/30/bunny-under-new-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: v0.5.4 Release Candidate 2</title>
		<link>http://bunnyamqp.wordpress.com/2009/09/29/bunny-v0-5-4-release-candidate-2/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/09/29/bunny-v0-5-4-release-candidate-2/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 13:33:32 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[candidate]]></category>
		<category><![CDATA[rc2]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=92</guid>
		<description><![CDATA[Bunny v0.5.4 rc2 is now available from GitHub. The code is now frozen as far as new features and enhancements are concerned. Of course, if you find any critical bugs please contact me as soon as you can so that the fix can be implemented. The changes included in the upcoming v0.5.4 release can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=92&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/celldee/bunny" target="_blank">Bunny</a> v0.5.4 rc2 is now available from <a href="http://github.com/celldee/bunny/downloads" target="_blank">GitHub</a>. The code is now frozen as far as new features and enhancements are concerned. Of course, if you find any critical bugs please contact me as soon as you can so that the fix can be implemented.</p>
<p>The changes included in the upcoming v0.5.4 release can be viewed in the Bunny <a href="http://wiki.github.com/celldee/bunny/future-changes" target="_blank">wiki</a>.</p>
<p>I intend to release the new gem on 5th  October 2009. If anyone needs more time to evaluate the changes please let me know and I will consider deferring the release.</p>
<br />Posted in Bunny, Releases Tagged: Bunny, candidate, rc2, release <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=92&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/09/29/bunny-v0-5-4-release-candidate-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: Quality of Service or Prefetch</title>
		<link>http://bunnyamqp.wordpress.com/2009/09/20/bunny-quality-of-service-or-prefetch/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/09/20/bunny-quality-of-service-or-prefetch/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 15:53:35 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>
		<category><![CDATA[prefetch]]></category>
		<category><![CDATA[quality of service]]></category>
		<category><![CDATA[subscribe]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=82</guid>
		<description><![CDATA[Up until now I&#8217;ve not really addressed the issue of subscription with Bunny by showing how it should be used in conjunction with the AMQP Basic.Qos method. This method implements the notion of AMQP Quality of Service. The Basic.Qos method is crucial to the successful operation of a Bunny consumer because it controls the flow [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=82&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Up until now I&#8217;ve not really addressed the issue of subscription with <a href="http://github.com/celldee/bunny" target="_blank">Bunny</a> by showing how it should be used in conjunction with the <a href="http://amqp.org" target="_blank">AMQP</a> <em>Basic.Qos</em> method. This method implements the notion of AMQP Quality of Service.</p>
<p>The <em>Basic.Qos</em> method is crucial to the successful operation of a Bunny consumer because it controls the flow of messages from the server to the client. The Bunny method <em>Client#qos</em> wraps <em>Basic.Qos</em> making it simple to call once a Bunny client is instantiated. <a href="http://rabbitmq.com" target="_blank">RabbitMQ</a> v1.6.0 only supports the <strong>:prefetch_count</strong> argument to that method at this time.</p>
<p>Here is an example</p>
<pre><code>
my_client.qos(:prefetch_count =&gt; 1)
</code>
</pre>
<p>or you could just do</p>
<pre><code>
my_client.qos
</code>
</pre>
<p>because <strong>:prefetch_count =&gt; 1</strong> is the default.</p>
<p>Using the <strong>:prefetch_count</strong> option means that if you turn on acknowledgements in your subscribe call using the <strong>:ack</strong> option like so</p>
<pre><code>
my_queue.subscribe(:ack =&gt; true)
</code>
</pre>
<p>the server will only send the number of messages specified in the <strong>:prefetch_count</strong> option to the client and then will wait until those messages have been acknowledged with the following method</p>
<pre><code>
my_queue.ack()
</code></pre>
<p>before it sends any more.</p>
<p>When a Bunny client subscribes to a queue, what it is doing under the covers is sending the AMQP <em>Basic.Consume</em> method to the server to register as a consumer on a particular queue. By default the server will try to send as many messages as it can down the communication channel. If your Bunny client can consume all of the messages before it tries to do anything else, everything works well. However, if you call another Bunny method before all of the messages on the queue have been consumed, you will see errors raised.</p>
<p>The errors are caused because Bunny will receive messages out of sequence. Most of the time, when you call a Bunny method a reply is expected from the server to confirm that the call was successful. If you don&#8217;t use <em>Client#qos</em> what can happen is this</p>
<ol>
<li>Client subscribes to queue.</li>
<li>Server sends as many messages as it can.</li>
<li>Client calls another Bunny method in the subscribe block, or after the subscribe method has completed, leaving messages still to be consumed.</li>
<li>The reply to that method gets queued up behind all of the incoming messages sent as a response to the subscribe method.</li>
<li> Client reads next message and receives one from the subscribe.</li>
<li>Client raises error because the received message is not the reply<br />
that was expected.</li>
</ol>
<p>The way to avoid these out of sequence problems is to do something like this</p>
<pre><code>
#========== Example consumer.rb ============

require 'bunny'

b = Bunny.new()
b.start

# Set Quality of Service
b.qos

q = b.queue
10.times { q.publish('Hey Ho') }

cnt = 0

q.subscribe(:ack =&gt; true) do |msg|
  cnt += 1
  msg_cnt = q.message_count
  puts '************************'
  puts "Message: #{cnt} - #{msg}"
  puts "#{msg_cnt} message(s) left in the queue"
  puts '************************'

  if msg_cnt &lt; 1
    q.unsubscribe
    q.ack
    break
  end

end

#============= Example end ==============
</code>
</pre>
<p>Ideally you don&#8217;t want to call the <em>Queue#message_count</em> method for every message in a large queue, but the code illustrates my point. By setting the <strong>:prefetch_count</strong> to 1 the subscribe block can call <strong>q.message_count</strong> and get a synchronous reply from the server. Afterwards <strong>q.ack</strong> is called which acknowledges receipt of the message and triggers the server to release the next set of messages &#8211; 1 in this case.</p>
<p>I hope that this will help Bunny users to get subscription working more to their liking.</p>
<br />Posted in Bunny Tagged: prefetch, quality of service, subscribe <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=82&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/09/20/bunny-quality-of-service-or-prefetch/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: Publishing with Merb and Rack</title>
		<link>http://bunnyamqp.wordpress.com/2009/09/04/bunny-publishing-with-merb-and-rack/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/09/04/bunny-publishing-with-merb-and-rack/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 08:55:03 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[User Stories]]></category>
		<category><![CDATA[Bunny]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[rack]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=51</guid>
		<description><![CDATA[The following article was written by Chris McCauley who kindly gave his permission for it to be published here. I discovered one big gotcha while integrating Bunny with Merb and wanted to share the solution. The background to this is that my company uses clusters of Merb and Rails processes to implement data validation services. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=51&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h5>The following article was written by Chris McCauley who kindly gave his permission for it to be published here.</h5>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p style="margin-bottom:0;" align="JUSTIFY">I discovered one big gotcha while integrating <a href="http://github.com/celldee/bunny" target="_blank">Bunny</a> with <a href="http://merbivore.com/" target="_blank">Merb</a> and wanted to share the solution.</p>
<p style="margin-bottom:0;" align="JUSTIFY">The background to this is that my company uses clusters of Merb and <a href="http://rubyonrails.org/" target="_blank">Rails</a> processes to implement data validation services.  Until recently our solution for monitoring the Merb part of the infrastructure was pretty manual, reactive and time consuming. I wanted a simple way to gather stats from Merb processes in the cluster and correlate them with activity on the host server and to do this over time. I also wanted email alerts to be sent when a request fails to meet its response target.</p>
<p style="margin-bottom:0;" align="JUSTIFY">I thought that message queuing might offer a good solution, allowing the aggregation of the request data and the production of  reports to be done with the minimum impact on the actual Merb processes. The idea was that each process in the cluster would  publish the timing information for  requests  to a queue and a separate profiler process would handle the graphing and alert functionality.</p>
<p style="margin-bottom:0;" align="JUSTIFY">I chose Bunny as the interface to RabbitMQ because it was synchronous. Although we use EventMachine to great effect elsewhere in our solution, it was a poor fit with the Merb architecture so the <a href="http://github.com/tmm1/amqp" target="_blank">tmm1-amqp</a> gem wasn&#8217;t really an option.</p>
<p style="margin-bottom:0;" align="JUSTIFY">I figured that this would be a simple implementation &#8211; Merb uses <a href="http://rack.rubyforge.org/" target="_blank">Rack</a> internally and provides access to the Rack framework via a “rackup” file. This provides a way to insert custom code into the request processing chain – in effect adding your own middle-ware into Merb. Profiling and monitoring is a middleware service so integrating Bunny and Rack here was the obvious choice.</p>
<p style="margin-bottom:0;" align="JUSTIFY">The structure of a rackup file is very simple. The basic rackup file that Merb uses is&#8230;</p>
<pre><code># use PathPrefix Middleware if :path_prefix is set in Merb::Config
if prefix = ::Merb::Config[:path_prefix]
  use Merb::Rack::PathPrefix, prefix
end

# this is our main merb application
run Merb::Rack::Application.new</code></pre>
<p>… this passes the inbound request straight to Merb for processing. To add custom middle-ware into the chain, you simple require your code and “use” it&#8230;</p>
<pre><code>
require 'bunny_profiler'

# use PathPrefix Middleware if :path_prefix is set in Merb::Config
if prefix = ::Merb::Config[:path_prefix]
  use Merb::Rack::PathPrefix, prefix
end

#  an interface to RabbitMQ via Bunny
use BunnyProfiler

# this is our main merb application
run Merb::Rack::Application.new
</code></pre>
<p>Obviously the “use” can be conditional, running in test environments but not production environments, on Tuesdays but not Thursdays etc.</p>
<p style="margin-bottom:0;" align="JUSTIFY">Each rack file is simple, apart from the constructor it has only one method called &#8216;call&#8217; which gets invoked in response to an inbound request. Since the call method gets a copy of all of the request headers, I figured that code as simple as this would work&#8230;</p>
<pre><code>
def call(env)
  status, headers, body = nil, nil, nil

  request_path  = env["REQUEST_URI"]
  request_input = env["rack.input"].read

  #  Call the next Rack app in sequence.
  #  Given our rackup file, this really means
  #  call our application and get it to
  #  process the request
  tm = Benchmark.measure {
    status, headers, body = @app.call(env)
  }

  #  Note that the pid of the sending process
  #  is part of the message
  #
  @queue.publish("#{Process.pid}” + “|" +
                            request_path    + "|" +
                            request_input   + "|" +
                            (tm.real).to_s)

  # This is the response required by Rack
  [status, headers, body]
end
</code></pre>
<p>The constructor is even simpler, we just set up a queue &#8230;</p>
<pre><code>
def initialize(app)
  @app = app

  @bunny = Bunny.new

  @bunny.start

  @queue = @bunny.queue('clavis.requests')
end
</code></pre>
<p>In the call method  we measure how long the main application code takes to process the request and then to send this to RabbitMQ. Each process in the cluster sends to the same queue and a single client process aggregates the data,  produces graphs and sends any alerts required.</p>
<p style="margin-bottom:0;" align="JUSTIFY">When I deployed this solution in the test environment, all was fine, graphs got produced, email alerts got sent. When I deployed it to one of our production servers, all was again fine –  for nearly a full day anyway.</p>
<p style="margin-bottom:0;" align="JUSTIFY">Then one-by-one each server in the cluster locked-up. When I checked the server log files, it became obvious that under heavy load, the calls to publish messages to the queue were failing. A quick check of the RabbitMQ log showed the following;</p>
<p style="margin-bottom:0;" align="JUSTIFY"><span style="font-family:Courier New,monospace;">=ERROR REPORT==== 14-Aug-2009::16:00:34 === </span></p>
<p style="margin-bottom:0;" align="JUSTIFY"><span style="font-family:Courier New,monospace;">connection &lt;0.18759.12&gt; (running), channel 1 &#8211; error: </span></p>
<p style="margin-bottom:0;" align="JUSTIFY"><span style="font-family:Courier New,monospace;">{amqp,command_invalid, </span></p>
<p style="margin-bottom:0;" align="JUSTIFY"><span style="font-family:Courier New,monospace;">&#8220;expected content header for class 60, got non content header frame instead&#8221;, </span></p>
<p style="margin-bottom:0;" align="JUSTIFY"><span style="font-family:Courier New,monospace;">none} </span></p>
<p style="margin-bottom:0;" align="JUSTIFY">This isn&#8217;t a particularly user-friendly error message. After some digging, I knew that this was somehow related to multiple messages being interleaved on the same channel causing RabbitMQ to close the socket connection. It seemed like a threading issues but I couldn&#8217;t see how my code could be wrong – it&#8217;s copied from the Bunny sample code! I didn&#8217;t want to give up on the solution; the combination of Bunny, Rabbit and Rack just seemed to be such a great approach.</p>
<p style="margin-bottom:0;" align="JUSTIFY">I had noticed one odd thing, RabbitMQ was seeing only one socket connection from all the servers in the cluster but I knew that each server was sending data &#8211; the messages being sent include the PID of the sending process. Perhaps Bunny was using a single connection to RabbitMQ and I needed to use some additional logic to handle that situation? I figured that there was nothing else for it but to try and contact the Bunny maintainer, Chris Duncan</p>
<p style="margin-bottom:0;" align="JUSTIFY">Chris was a great help. He confirmed that there&#8217;s nothing in Bunny which could cause the same connection to be reused by all the servers but perhaps I could look at the use of different channels for each server as well as turning on the Bunny debug log.</p>
<p style="margin-bottom:0;" align="JUSTIFY">Odd as it may seem, it was the second suggestion – turning on the log file which provided the big clue. Since turning on logging is part of the initialisation step (for me anyway), I changed the initialize method to be &#8230;</p>
<pre><code>
def initialize(app)
  @app = app

  @bunny = Bunny.new

  @bunny.logfile = "/var/log/bunny-#{Process.pid}.log"

  @bunny.logging = true

  @bunny.start

  @queue = @bunny.queue('clavis.requests')
end
</code></pre>
<p>&#8230; and restarted all of the servers in the test cluster. My idea was that I would try and reproduce the problem in the test environment by sending as many requests at the same time as possible and by brute-force, make the problem reoccur.</p>
<p style="margin-bottom:0;" align="JUSTIFY">I didn&#8217;t get that far, I noticed that only one log file was getting created instead of the twelve that I was expecting. That really looked like only one Merb process in the cluster was initialising Bunny – but I knew (from the reports getting produced) that each process was sending data. This was a contradiction – how could only one process have initialised Bunny yet all of the processes be sending messages?</p>
<p style="margin-bottom:0;" align="JUSTIFY">The explanation was that only one process was actually initialising Bunny and because of the name of the log file I knew which one it was –  the Merb spawner process. The  spawner process was opening the socket connection to RabbitMQ via Bunny, then forking the child processes and since children inherit the socket connections, each process was sending on the same channel and on the same socket. Sooner or later two messages would get interleaved and RabbitMQ would drop the connection.</p>
<p style="margin-bottom:0;" align="JUSTIFY">The solution was simple, I moved all of the initialisation code out of the constructor and introduced a new start_bunny method which did essentially the same thing and called this like so &#8230;</p>
<pre><code>
def call(env)
  status, headers, body = nil, nil, nil

  request_path  = env["REQUEST_URI"]
  request_input = env["rack.input"].read

  tm = Benchmark.measure {
    status, headers, body = @app.call(env)
  }

  start_bunny unless @queue

  @queue.publish("#{Process.pid}” + “|" +
                            request_path    + "|" +
                            request_input   + "|" +
                            (tm.real).to_s)

  [status, headers, body]
end
</code></pre>
<p>Now each process in the cluster initialises Bunny as required. Since the socket connections are distinct, it&#8217;s safe to use the default channel. Testing showed multiple connection requests going from Bunny to RabbitMQ – something which Chris had been expecting and multiple log files being created – which I had expected. More importantly, ten thousand requests later, the problem hasn&#8217;t reoccurred.</p>
<br />Posted in User Stories Tagged: Bunny, merb, rack <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=51&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/09/04/bunny-publishing-with-merb-and-rack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: Ruby IRB auto-completion issue</title>
		<link>http://bunnyamqp.wordpress.com/2009/08/24/bunny-ruby-irb-auto-completion-issue/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/08/24/bunny-ruby-irb-auto-completion-issue/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 09:32:18 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>
		<category><![CDATA[auto-completion]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[irb]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=43</guid>
		<description><![CDATA[It was brought to my attention by Sho Fukamachi that a repeatable error occurs when trying to use IRB auto-completion with Bunny in some versions of Ruby 1.8.6 and 1.8.7. The problem does not occur in Ruby 1.9.1 and seems to have been fixed in Ruby 1.8.6 p287. In your IRB session, if you see [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=43&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It was brought to my attention by <a href="http://fukamachi.org" target="_blank">Sho Fukamachi</a> that a repeatable error occurs when trying to use <a href="http://en.wikipedia.org/wiki/Interactive_Ruby_Shell" target="_blank">IRB</a> auto-completion with Bunny in some versions of <a href="http://ruby-lang.org" target="_blank">Ruby</a> 1.8.6 and 1.8.7. The problem does not occur in Ruby 1.9.1 and seems to have been fixed in Ruby 1.8.6 p287.</p>
<p>In your IRB session, if you see something like the following  -</p>
<pre><code>
q.me/Users/chrisduncan/ruby186/lib/ruby/1.8/irb/completion.rb:159: can't convert Symbol
into String (TypeError) ...
</code></pre>
<p>It appears to be a bug in irb/completion.rb. I applied the following patch to fix it -</p>
<p>Change the line:</p>
<pre><code>
/^(IRB|SLex|RubyLex|RubyToken)/ =~ name
</code></pre>
<p>To:</p>
<pre><code>
/^(IRB|SLex|RubyLex|RubyToken)/ =~ name.to_s
</code></pre>
<p>Personally, I would advise installing an officially patched version of Ruby to remedy the issue. However, as always, the choice is yours.</p>
<p><strong>Update (21/07/2011)</strong> -</p>
<p>As a result of further investigation there is a remedy to this issue that has been implemented in Bunny. It will be included in the next release of the gem, however, if you need to get a patched version more quickly, both the 0.7.x-stable and master branches on <a href="http://github.com/ruby-amqp/bunny">GitHub</a> include the patch.</p>
<br />Posted in Bunny Tagged: auto-completion, Bunny, error, irb <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=43&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/08/24/bunny-ruby-irb-auto-completion-issue/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>Bunny: Future development</title>
		<link>http://bunnyamqp.wordpress.com/2009/08/23/bunny-future-development/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/08/23/bunny-future-development/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 10:46:22 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Bunny]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[future]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=39</guid>
		<description><![CDATA[Bunny has now reached a state where it makes most of the core AMQP functionality available. It is being used in the real world and seems to be doing a reasonable job for its users. Up until now I’ve been doing things with Bunny that I wanted to do, with some occasional help from interested [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=39&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/celldee/bunny" target="_blank">Bunny</a> has now reached a state where it makes most of the core <a href="http://amqp.org" target="_blank"><span>AMQP</span></a> functionality available. It is being used in the real world and seems to be doing a reasonable job for its users.</p>
<p>Up until now I’ve been doing things with Bunny that I wanted to do, with some occasional help from interested parties (for which I am very grateful). I have no formal change management procedure (except for the use of the remarkable Git), no release candidates etc. If anybody thinks that a more formal structure is required then I’m open to suggestions.</p>
<p>What I would like is for the ‘Bunny community’ – if there is one – to drive its future development. I want to get a better feel for where and how Bunny is being used with a view to improving it further. So if you have examples of ‘real world’ Bunny usage, if you require features that don’t already exist, if you have encountered problems that you want fixed or if you have suggestions as to how Bunny can be enhanced, please let me know. You are also encouraged to fork and patch to your heart’s content.</p>
<p>Version 1.7 of <a href="http://rabbitmq.com" target="_blank">RabbitMQ</a> is due out quite soon and I expect Bunny to be compatible with it. For the time being I’m going to concentrate on polishing Bunny as best I can.</p>
<p>Finally, I’d like to say that I’m enjoying working on this project immensely and would like to thank the numerous people who have made, and continue to make, software and services available free of charge. Without their generosity I’m sure that I would never have started this project.</p>
<br />Posted in Bunny Tagged: Bunny, development, future <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=39&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/08/23/bunny-future-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>AMQP: Basic.Publish immediate versus mandatory</title>
		<link>http://bunnyamqp.wordpress.com/2009/08/21/amqp-basic-publish-immediate-versus-mandatory/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/08/21/amqp-basic-publish-immediate-versus-mandatory/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 13:10:30 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[AMQP Specification]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[publish]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=20</guid>
		<description><![CDATA[I was unclear about the difference between the mandatory and immediate options for the AMQP Basic.Publish method, so I did a little investigation with Bunny and RabbitMQ. It turns out that the difference is pretty straightforward. If you publish a message with the :mandatory option set to true like so - my_exchange.publish('Test message', :mandatory =&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=20&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was unclear about the difference between the mandatory and immediate options for the <a href="http://amqp.org" target="_blank">AMQP</a> <em>Basic.Publish</em> method, so I did a little investigation with <a href="http://github.com/celldee/bunny" target="_blank">Bunny</a> and <a href="http://rabbitmq.com" target="_blank">RabbitMQ</a>.</p>
<p>It turns out that the difference is pretty straightforward. If you publish a message with the <strong>:mandatory</strong> option set to true like so -</p>
<pre>
<code>
my_exchange.publish('Test message', :mandatory =&gt; true)
</code>
</pre>
<p>Then your message will be returned unless it can be routed to a queue.</p>
<p>However, if you publish a message with the <strong>:immediate</strong> option set to true, as in this example -</p>
<pre>
<code>
my_exchange.publish('Test message', :immediate =&gt; true)
</code>
</pre>
<p>Then your message will be returned unless it can be consumed immediately.</p>
<p><strong>IMPORTANT:</strong> If you use either of these options with <em>Exchange#publish</em> in Bunny, you <strong>must</strong> check whether or not your message has been returned after you make the publish call, otherwise return messages will build up and problems will ensue. With Bunny you can check for returned messages by placing something similar to the following after your publish call -</p>
<pre>
<code>
returned_msg = my_client.returned_message
</code>
</pre>
<p>The <em>Client#returned_message</em> method takes an optional <strong>:timeout</strong> argument (default value is 0.1 seconds). This allows you to specify how long the method will wait to receive a returned message should the default value prove to be problematic.</p>
<p>If there is a returned message the method returns a hash containing <strong>:header</strong>, <strong>:payload</strong> and <strong>:return_details</strong>. The payload contains the message contents. If there is no returned message the method returns the symbol <strong>:no_return</strong>.</p>
<br />Posted in AMQP Specification Tagged: amqp, publish <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=20&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/08/21/amqp-basic-publish-immediate-versus-mandatory/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
		<item>
		<title>AMQP: LRUG quick overview</title>
		<link>http://bunnyamqp.wordpress.com/2009/08/21/amqp-lrug-quick-overview/</link>
		<comments>http://bunnyamqp.wordpress.com/2009/08/21/amqp-lrug-quick-overview/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 10:47:55 +0000</pubDate>
		<dc:creator>Chris Duncan</dc:creator>
				<category><![CDATA[Videos]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[lrug]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://bunnyamqp.wordpress.com/?p=22</guid>
		<description><![CDATA[At the London Ruby User Group (LRUG) meeting on the 12th August 2009, Alex Graul gave a brief, well-presented talk about AMQP and a couple of Ruby clients that can be used to work with it (Bunny gets a mention along with the excellent asynchronous amqp library &#8211; thanks Alex). This is a pretty high [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=22&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At the <a href="http://lrug.org" target="_blank">London Ruby User Group</a> (LRUG) meeting on the 12th August 2009, Alex Graul gave a brief, well-presented talk about <a href="http://amqp.org" target="_blank">AMQP</a> and a couple of Ruby clients that can be used to work with it (<a href="http://github.com/celldee/bunny" target="_blank">Bunny</a> gets a mention along with the excellent asynchronous <a href="http://github.com/tmm1/amqp/" target="_blank">amqp</a> library &#8211; thanks Alex). This is a pretty high level fly-past, but it serves as a pleasant appetizer for those who are new to the subject.</p>
<p>Unfortunately, I could not attend the meeting, so for all of you that were also unable to be there, here is a link to a video of the talk courtesy of <a href="http://skillsmatter.com" target="_blank">Skills Matter</a> and <a href="http://vimeo.com" target="_blank">Vimeo</a> -</p>
<p><a href="http://skillsmatter.com/podcast/ajax-ria/amqp-in-ruby" target="_blank">http://skillsmatter.com/podcast/ajax-ria/amqp-in-ruby</a></p>
<br />Posted in Videos Tagged: amqp, lrug, talk, video <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bunnyamqp.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bunnyamqp.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bunnyamqp.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bunnyamqp.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bunnyamqp.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bunnyamqp.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bunnyamqp.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bunnyamqp.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bunnyamqp.wordpress.com&amp;blog=9060206&amp;post=22&amp;subd=bunnyamqp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bunnyamqp.wordpress.com/2009/08/21/amqp-lrug-quick-overview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2adbbe58bd5008a7ba6180de2414cd91?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rotsog</media:title>
		</media:content>
	</item>
	</channel>
</rss>
