<?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>Silas Sewell - August 2009</title>
        <atom:link href="http://www.silassewell.com/blog/2009/08/rss2.xml" rel="self" type="application/rss+xml" />
        <link>http://www.silassewell.com/blog/2009/08</link>
        <description>Infrastructure Development</description>
        <lastBuildDate>Sat, 21 Aug 2010 00:00:00 GMT</lastBuildDate>
        <generator>http://www.silassewell.com/</generator>
        <language>en</language>
        <sy:updatePeriod>hourly</sy:updatePeriod>
        <sy:updateFrequency>1</sy:updateFrequency>

        <item>
            <title>Stomping with Python and ActiveMQ (Stomp Framework)</title>
            <link>http://www.silassewell.com/blog/2009/08/27/stomping-with-python-and-activemq-stomp-framework/</link>
            <pubDate>Thu, 27 Aug 2009 00:00:00 GMT</pubDate>
            <dc:creator>silas</dc:creator>
            <category><![CDATA[ActiveMQ]]></category><category><![CDATA[Fedora]]></category><category><![CDATA[Programming]]></category><category><![CDATA[Projects]]></category><category><![CDATA[Python]]></category><category><![CDATA[python-stomping]]></category><category><![CDATA[STOMP]]></category>
            <guid isPermaLink="true">http://www.silassewell.com/blog/2009/08/27/stomping-with-python-and-activemq-stomp-framework/</guid>
            <description><![CDATA[<p><a href="http://silassewell.googlecode.com/svn/trunk/projects/python-stomping" title="Python Stomping">python-stomping</a> is a simple <a href="http://en.wikipedia.org/wiki/Streaming_Text_Orientated_Messaging_Protocol" title="Stomp">Stomp</a> framework I wrote which makes
creating stomp services in Python easy.</p>

<ol>
<li><p>Install requirements</p>

<pre><code class="prettyprint">$ sudo yum install python-twisted python-stomper
</code></pre></li>
<li><p>Checkout stomping</p>

<pre><code class="prettyprint">$ svn export http://silassewell.googlecode.com/svn/trunk/projects/python-stomping python-stomping
$ cd python-stomping
</code></pre></li>
<li><p>Update the <code class="prettyprint">example.py</code> file to use your <code class="prettyprint">host</code>, <code class="prettyprint">port</code>, <code class="prettyprint">username</code> and
<code class="prettyprint">password</code> ActiveMQ/Stomp broker settings</p>

<pre><code class="prettyprint">from stomping import Stomping, route

class MyStomping(Stomping):

def init(self):
    self.send('/queue/test1', 'init test1')
    self.send('/queue/test2', 'init test2')

@route('/queue/test1')
def a_test(self, message):
    print 'a_test: %s' % message['body']

@route('/queue/test1')
@route('/queue/test2')
def b_test(self, message):
    print 'b_test: %s' % message['body']

if __name__ == '__main__':
    stomp = MyStomping(host='127.0.0.1', port=61613, username='guest', password='guest')
    stomp.run()
</code></pre></li>
<li><p>Run <code class="prettyprint">example.py</code> (Ctrl+c to quit)</p>

<pre><code class="prettyprint">$ python example.py 
a_test: init test1
b_test: init test1
b_test: init test2
</code></pre></li>
</ol>

<p>NOTE: python-stomping is just a light wrapper around Twisted and stomper and is
based on an <a href="http://code.google.com/p/stomper/source/browse/trunk/lib/stomper/examples/sender.py" title="sender example">example</a> provided in the stomper code.</p>]]></description>
        </item>

    </channel>
</rss>