<?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>Bit Mojo - Hiram Chirino &#187; Java</title>
	<atom:link href="http://hiramchirino.com/blog/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://hiramchirino.com/blog</link>
	<description>My Ramblings on Hawt Tech</description>
	<lastBuildDate>Mon, 26 Jul 2010 16:30:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HawtDispatch Event Based IO</title>
		<link>http://hiramchirino.com/blog/2010/07/hawtdispatch-event-based-io/</link>
		<comments>http://hiramchirino.com/blog/2010/07/hawtdispatch-event-based-io/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 16:28:50 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[HawtDispatch]]></category>
		<category><![CDATA[NIO]]></category>
		<category><![CDATA[Threading]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/blog/?p=142</guid>
		<description><![CDATA[My previous post promised a follow up to explain how network IO events are handled by HawtDispatch.  Before I get into the details, I urge you to read Mark McGranaghan&#8217;s post on Threaded vs Evented Servers.  He does an excellent job describing how event driven servers scale in comparison to threaded servers.   This post [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://hiramchirino.com/blog/2010/06/scaling-up-with-hawtdispatch/">previous post</a> promised a follow up to explain how network IO events are handled by <a href="http://hawtdispatch.fusesource.org" onclick="pageTracker._trackPageview('/outgoing/hawtdispatch.fusesource.org?referer=');">HawtDispatch</a>.  Before I get into the details, I urge you to read Mark McGranaghan&#8217;s post on <a href="http://mmcgrana.github.com/2010/07/threaded-vs-evented-servers.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/mmcgrana.github.com/2010/07/threaded-vs-evented-servers.html?referer=');">Threaded vs Evented Servers</a>.  He does an excellent job describing how event driven servers scale in comparison to threaded servers.   This post will try to highlight how HawtDispatch provides an excellent framework for the implementation of event based servers.</p>
<p>When implementing event based servers, there are generally 2 patterns used, the <a href="http://www.cs.wustl.edu/~schmidt/PDF/reactor-siemens.pdf" onclick="pageTracker._trackPageview('/outgoing/www.cs.wustl.edu/_schmidt/PDF/reactor-siemens.pdf?referer=');">reactor pattern</a> and the<a href="http://www.cs.wustl.edu/~schmidt/PDF/proactor.pdf" onclick="pageTracker._trackPageview('/outgoing/www.cs.wustl.edu/_schmidt/PDF/proactor.pdf?referer=');"> proactor pattern</a>.  The reactor pattern can be though of as being a synchronous version of the proactor pattern.  In a reactor pattern IO events are serviced by the thread in the IO handling loop.  In a proactor pattern the thread processing the IO event loop passes off the the IO event to another thread for processing.  HawtDispatch can support both styles of IO processing.</p>
<p>HawtDispatch uses a fixed sized thread pool sized to match the number of cores on your system.  Each thread in the pool runs an IO handling loop.  When a <a href="http://hawtdispatch.fusesource.org/#nio_dispatch_source" onclick="pageTracker._trackPageview('/outgoing/hawtdispatch.fusesource.org/_nio_dispatch_source?referer=');">NIO event source</a> is created, it gets assigned to one of the threads.  When network events occur the source causes callbacks to occur against on the dispatch queue targeted in the event source.  Typically that target dispatch queue is set to a serial queue which the application uses to handle the network protocol.  Since it&#8217;s a serial queue, the handling of the event can be done in a thread safe way.  The proactor pattern is being used since the serial queue can execute in any of the threads in the thread pool .</p>
<p>To use the reactor pattern, HawtDispatch supports &#8216;pinning&#8217; the serial queue to a thread.  When a dispatch source is created on a pinned dispatch queue, then the event source gets registered against the same &#8216;pinned&#8217; thread.  The benefit of the reactor pattern is that it avoids some of  cross thread synchronization needed for the proactor pattern and provides cheaper GCs.  The down side to the reactor pattern is that you may have to manage reblanacing network sources across all the available thread.  Lucky HawtDispatch does support moving pinned dispatch queues and sources to different threads.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2010/07/hawtdispatch-event-based-io/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scaling Up with HawtDispatch</title>
		<link>http://hiramchirino.com/blog/2010/06/scaling-up-with-hawtdispatch/</link>
		<comments>http://hiramchirino.com/blog/2010/06/scaling-up-with-hawtdispatch/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 16:04:08 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[Scala]]></category>
		<category><![CDATA[HawtDispatch]]></category>
		<category><![CDATA[NIO]]></category>
		<category><![CDATA[Threading]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/blog/?p=127</guid>
		<description><![CDATA[I just spotted an excellent article on how reducing the number of cores used by a multi-threaded actually increased it&#8217;s performance.  This seems counter intuitive at first, but it is a sad reality.  It is very easy to create contention across threads in a multi-threaded app which in turn lowers performance.
A few months ago, I [...]]]></description>
			<content:encoded><![CDATA[<p>I just spotted an<a href="http://mailinator.blogspot.com/2010/02/how-i-sped-up-my-server-by-factor-of-6.html" onclick="pageTracker._trackPageview('/outgoing/mailinator.blogspot.com/2010/02/how-i-sped-up-my-server-by-factor-of-6.html?referer=');"> excellent article</a> on how reducing the number of cores used by a multi-threaded actually increased it&#8217;s performance.  This seems counter intuitive at first, but it is a sad reality.  It is very easy to create contention across threads in a multi-threaded app which in turn lowers performance.</p>
<p>A few months ago, I experienced similar results while hacking on ActiveMQ.  I noticed that passing messages from producer connections to consumer connections was dramatically faster if the producer and consumer were being serviced by the same thread.  I decided that the next version of the broker would to be need to be built using a thread management framework which could optimize itself so that those connections could collocate onto one thread if possible.</p>
<p>Then I saw the the <a href="http://libdispatch.macosforge.org/" onclick="pageTracker._trackPageview('/outgoing/libdispatch.macosforge.org/?referer=');">libdispatch</a> API (it forms the foundation of the<a href="http://developer.apple.com/mac/articles/cocoa/introblocksgcd.html" onclick="pageTracker._trackPageview('/outgoing/developer.apple.com/mac/articles/cocoa/introblocksgcd.html?referer=');"> Grand Central Dispatch</a> technology in OS X) and fell in love with it&#8217;s simplicity and power.  I realized that implementation of that API could in theory provides the threading optimizations I was looking for.  So I started hacking on <a href="http://hawtdispatch.fusesource.org/" onclick="pageTracker._trackPageview('/outgoing/hawtdispatch.fusesource.org/?referer=');">HawtDispatch</a>, a Java/Scala clone of libdispatch.</p>
<p>The central concepts to libdispatch and hawtdispatch are global and serial queues.  Global queues are executors which execute tasks concurrently using a  fixed size thread pool. Serial queues are executors without an assigned thread and which execute tasks in FIFO order.   When tasks added to a serial queue, the serial queue gets added to a global queue so that the serial queue can execute it&#8217;s tasks.  Multiple serial queues execute concurrently on the global queue.</p>
<p>The overhead of a serial queue is very small, it&#8217;s just a several counters and a couple of linked lists.  You can use them like a lightweight thread. Feel free to create thousands of them.  If you squint at it just right, they allows you to use erlang style actor thread model.</p>
<p>Now that you have an idea how HawtDispatch is used, lets get back to what kinds of optimizations it can do to help with cross thread contention.  HawtDispatch generally uses a concurrent linked list to enqueue a task in serial queue, but there are times when it can avoid that synchronization of the concurrent linked list.  For example, if the serial queue is currently executing in the current thread, then an enqueue can just add the task to a non synchronized linked list.  HawtDispatch also supports &#8216;pining&#8217; a serial queue to one of the threads in the global queue&#8217;s thread pool.  This allows you to force serial queues to collocate onto one thread so that when they do need to communicate, there is no thread contention involved.</p>
<p>But you still run into cases where you need to move tons of events from one serial queue to another which is executing on a different thread.  For these cases, you use a custom event source.  It allows you to  coalesce a bunch of events generated on on thread as a single event delivered to the another queue.  HawtDispatch will aggregate custom events  into a thread local (to avoid contention) and once the current thread has drained all execution queues, it will deliver those custom events to their target queues.</p>
<p>This post is already getting kind of long, so I&#8217;ve have to do <a href="http://hiramchirino.com/blog/2010/07/hawtdispatch-event-based-io/">a follow up post</a> on how all that interacts with network IO events.  But the general idea is, yes, keeping stuff on 1 core is fast, but it won&#8217;t scale once your CPU bound, so having a framework like can HawtDispatch help minimize cross thread contention while still providing the ability to scale up to multiple cores as load increases.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2010/06/scaling-up-with-hawtdispatch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Jansi 1.2 Released</title>
		<link>http://hiramchirino.com/blog/2010/02/jansi-1-2-released/</link>
		<comments>http://hiramchirino.com/blog/2010/02/jansi-1-2-released/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 22:19:10 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[jansi]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/blog/?p=125</guid>
		<description><![CDATA[I&#8217;m happy to announce that Jansi 1.2 has been released.  It addresses a couple of small bugs and adds a few minor enhancements.  See the full change log for more details.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to announce that <a href="http://jansi.fusesource.org" onclick="pageTracker._trackPageview('/outgoing/jansi.fusesource.org?referer=');">Jansi</a> 1.2 has been released.  It addresses a couple of small bugs and adds a few minor enhancements.  See the <a href="http://github.com/chirino/jansi/blob/master/changelog.md" onclick="pageTracker._trackPageview('/outgoing/github.com/chirino/jansi/blob/master/changelog.md?referer=');">full change log</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2010/02/jansi-1-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fuse Community Day: San Francisco</title>
		<link>http://hiramchirino.com/blog/2009/12/fuse-community-day-san-francisco/</link>
		<comments>http://hiramchirino.com/blog/2009/12/fuse-community-day-san-francisco/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 18:20:33 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[camel]]></category>
		<category><![CDATA[cxf]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[servicemix]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/blog/?p=117</guid>
		<description><![CDATA[I just found out I&#8217;m going to heading out to San Francisco to attend the Fuse Community Day!
Progress Software is sponsoring an Apache ServiceMix, ActiveMQ, CXF &#38; Camel Community Day on Thursday, December 10th, at the Hyatt Hotel in Burlingame. Join us at this free event and meet committers and founders of Apache ServiceMix, ActiveMQ, [...]]]></description>
			<content:encoded><![CDATA[<p>I just found out I&#8217;m going to heading out to San Francisco to attend the Fuse Community Day!</p>
<blockquote><p>Progress Software is sponsoring an Apache ServiceMix, ActiveMQ, CXF &amp; Camel Community Day on Thursday, December 10th, at the Hyatt Hotel in Burlingame. Join us at this free event and meet committers and founders of Apache ServiceMix, ActiveMQ, CXF and Camel that have successfully implemented enterprise application and deployed these projects in production.</p></blockquote>
<p>Should fun to meet users/developers of these kick ass Apache based projects.  If you plan on going, make sure your <a href="http://form.fusesource.com/forms/registersf2009" onclick="pageTracker._trackPageview('/outgoing/form.fusesource.com/forms/registersf2009?referer=');">register for the event</a>.  It&#8217;ll be nice to meet everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/12/fuse-community-day-san-francisco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RestyGWT, a Better GWT RPC??</title>
		<link>http://hiramchirino.com/blog/2009/10/restygwt-a-better-gwt-rpc/</link>
		<comments>http://hiramchirino.com/blog/2009/10/restygwt-a-better-gwt-rpc/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 23:50:38 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[resty-gwt]]></category>
		<category><![CDATA[rpc]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/blog/?p=63</guid>
		<description><![CDATA[If your familiar with GWT RPC, then you you know that it&#8217;s it&#8217;s provides a very nice client side framework for doing AJAX requests against Java Servlets.  The sad part is that it uses a binary protocol.  That protocol is not easily understood by other languages or frameworks.
Counter that with latest AJAX rage, RESTful services [...]]]></description>
			<content:encoded><![CDATA[<p>If your familiar with <a href="http://code.google.com/webtoolkit/doc/1.6/DevGuideServerCommunication.html#DevGuideRemoteProcedureCalls" onclick="pageTracker._trackPageview('/outgoing/code.google.com/webtoolkit/doc/1.6/DevGuideServerCommunication.html_DevGuideRemoteProcedureCalls?referer=');">GWT RPC</a>, then you you know that it&#8217;s it&#8217;s provides a very nice client side framework for doing AJAX requests against Java Servlets.  The sad part is that it uses a binary protocol.  That protocol is not easily understood by other languages or frameworks.</p>
<p>Counter that with latest AJAX rage, RESTful services with a JSON or XML representation of the data.  The nice thing about using JSON with REST services is that clients and servers can easily be built it any language.  Wouldn&#8217;t it be nice if you use JSON RESTful services from GWT with the ease of GWT RPC?</p>
<p>That&#8217;s exactly the reason I started hacking on <a href="http://github.com/chirino/resty-gwt" onclick="pageTracker._trackPageview('/outgoing/github.com/chirino/resty-gwt?referer=');">RestyGWT</a>.  It uses a very similar development model as GWT RPC.  You create a service interface who&#8217;s implementation is code generated via Deferred Binding when your GWT module is built.  The developer maps the interface methods to RESTful HTTP requests using the excelent <a href="https://jsr311.dev.java.net/nonav/releases/1.0/index.html" onclick="pageTracker._trackPageview('/outgoing/jsr311.dev.java.net/nonav/releases/1.0/index.html?referer=');">JAX-RS</a> annotations.  Just like in GWT RPC, the interface must be &#8216;asynchronous&#8217;.  You must use callback method arguments to get the request results.  But unlike GWT RPC, the data sent and received will be JSON encoded.  <a href="http://github.com/chirino/resty-gwt" onclick="pageTracker._trackPageview('/outgoing/github.com/chirino/resty-gwt?referer=');">RestyGWT</a> will automatically code generate JSON encoders and decoders for any classes sent or received from the rest service.</p>
<p>For more details see the Git Hub home page at: <a href="http://github.com/chirino/resty-gwt" onclick="pageTracker._trackPageview('/outgoing/github.com/chirino/resty-gwt?referer=');">http://github.com/chirino/resty-gwt</a></p>
<p>As of this point, RestyGWT only implements the most basic JAX-RS annotations and provides a very simple JSON encoding scheme.  Despite that, the project is already extremely useful.  I would love here what folks think about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/10/restygwt-a-better-gwt-rpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RMI via JMS 1.0 Released!</title>
		<link>http://hiramchirino.com/blog/2009/10/rmi-via-jms-1-0-released/</link>
		<comments>http://hiramchirino.com/blog/2009/10/rmi-via-jms-1-0-released/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:28:26 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[remoting]]></category>
		<category><![CDATA[rmi]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/blog/?p=61</guid>
		<description><![CDATA[I&#8217;m pleased to announce the release of RMI via JMS 1.0!  RMI via JMS allows you do RMI style remoting over any JMS provider.  It combines the ease of RMI development with flexibility and loose coupling that JMS provides.
It also supports and even simpler interface remoting model which does not mandate the throwing of RemoteException [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pleased to announce the release of <a href="http://rmiviajms.fusesource.org/repo/release/org/fusesource/rmiviajms/rmiviajms/1.0/rmiviajms-1.0.jar" onclick="pageTracker._trackPageview('/outgoing/rmiviajms.fusesource.org/repo/release/org/fusesource/rmiviajms/rmiviajms/1.0/rmiviajms-1.0.jar?referer=');">RMI via JMS 1.0</a>!  <a href="http://rmiviajms.fusesource.org/index.html" onclick="pageTracker._trackPageview('/outgoing/rmiviajms.fusesource.org/index.html?referer=');">RMI via JMS</a> allows you do RMI style remoting over any JMS provider.  It combines the ease of <a href="http://java.sun.com/docs/books/tutorial/rmi/index.html" onclick="pageTracker._trackPageview('/outgoing/java.sun.com/docs/books/tutorial/rmi/index.html?referer=');">RMI development</a> with flexibility and loose coupling that <a href="http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html" onclick="pageTracker._trackPageview('/outgoing/java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/jms_tutorialTOC.html?referer=');">JMS</a> provides.</p>
<p>It also supports and even simpler interface remoting model which does not mandate the throwing of <code>RemoteException</code> or extending the <code>RemoteObject</code> interfaces.  It even allows remoting classes which don&#8217;t implement any interfaces via ASM magic.</p>
<p>Documentation still needs a little work, but the project is now <a href="http://www.apache.org/licenses/LICENSE-2.0.html" onclick="pageTracker._trackPageview('/outgoing/www.apache.org/licenses/LICENSE-2.0.html?referer=');">ASL 2.0 Licensed</a> and looking for contributions!  Please join the <a href="http://rmiviajms.fusesource.org/community.html" onclick="pageTracker._trackPageview('/outgoing/rmiviajms.fusesource.org/community.html?referer=');">mailing lists</a> to get involved.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/10/rmi-via-jms-1-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ActiveMQ Protobuf Implemtation Features</title>
		<link>http://hiramchirino.com/blog/2009/09/activemq-protobuf-implemtation-features/</link>
		<comments>http://hiramchirino.com/blog/2009/09/activemq-protobuf-implemtation-features/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:57:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[protobuf]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2009/09/activemq-protobuf-implemtation-features/</guid>
		<description><![CDATA[I promised I would follow up on my previous post on how the &#8220;The ActiveMQ Protobuf Implementation Rocks!&#8221;.
So you might be asking yourself, what&#8217;s the secret sauce? Well before I get into that, let me first explain the class model that our proto compiler generates.
For every message definition in the &#8216;.proto&#8217; file, the compiler will [...]]]></description>
			<content:encoded><![CDATA[<p>I promised I would follow up on my previous post on how the <a href="http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks">&#8220;The ActiveMQ Protobuf Implementation Rocks!&#8221;.</a></p>
<p>So you might be asking yourself, what&#8217;s the secret sauce? Well before I get into that, let me first explain the class model that our proto compiler generates.</p>
<p>For every message definition in the &#8216;.proto&#8217; file, the compiler will generate 3 classes:
<ul>
<li>the message interface: is implemented by the bean and buffer classes.  It has all the &#8216;getters&#8217;.</li>
<li>the bean class: has all the &#8217;setters&#8217; and &#8216;merge&#8217; methods</li>
<li>the buffer class: has all the encoding and decoding methods.  It does not allow mutation.</li>
</ul>
<p>The message interface also defines the freeze(), frozen(), and copy() methods which allow you to make an instance immutable, check to see if an instance is immutable, and create a mutable copy.  Buffer classes are alway immutable.  Bean class can transition to being immutable via freeze().  freeze() naturally returns a buffer object.  copy() naturally returns a bean object.</p>
<p>This bean model gives substantial flexibility.  Besides making it easy to transition from immutable to mutable and back, the message interface lets you implement business methods that operate against either type of instance.  You could use the bean class purely in a builder style to always generate a buffer instance, or you could just use them like traditional java bean objects.</p>
<p>Once a bean instance is frozen, any attempts to modify the instance will throw assertion errors if assertions are enabled in your JVM.  So the CPU cost of validating program correctness can can be disabled at run time.</p>
<p>Finally, the most important feature of the buffer class is that it holds on to either the byte array that it was created from or the frozen bean that created it, and sometimes both, after it builds one from the other.  This has several implications.  Firstly, once a buffer is encoded to a byte[], subsequent encoding passes are free.  This is also true when a buffer is decoded, as the next encoding is free since it still retains the original encoding of the message.  And the other benefit that this provides which the benchmark highlighted, is that deferred decoding is possible.  A newly created buffer class will not decode the data until a field is accessed.  This also true of the nested messages that are encoded in a buffer.  While the outer message may get decoded, the nested message will not be decoded until it&#8217;s fields are accessed.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/09/activemq-protobuf-implemtation-features/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The ActiveMQ Protobuf Implementation Rocks!</title>
		<link>http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks/</link>
		<comments>http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 05:15:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[activemq]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[protobuf]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2009/09/the-activemq-protobuf-implementation-rocks/</guid>
		<description><![CDATA[While reading Comparing the Java Serialization Options I ran across the a cool google code project which has done an excellent job benchmarking a wide variety of serialization options for java.
I&#8217;ve had been researching the protobuf encoding format for a while and really liked it.  But I did not really like the Java implementation [...]]]></description>
			<content:encoded><![CDATA[<p>While reading <a href="http://www.theserverside.com/news/thread.tss?thread_id=57871" onclick="pageTracker._trackPageview('/outgoing/www.theserverside.com/news/thread.tss?thread_id=57871&amp;referer=');">Comparing the Java Serialization Options</a> I ran across the a <a href="http://code.google.com/p/thrift-protobuf-compare/" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/thrift-protobuf-compare/?referer=');">cool google code project</a> which has done an excellent job <a href="http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking?ts=1237772203&amp;updated=Benchmarking" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking?ts=1237772203_amp_updated=Benchmarking&amp;referer=');">benchmarking</a> a wide variety of serialization options for java.</p>
<p>I&#8217;ve had been researching the <span class="blsp-spelling-error" id="SPELLING_ERROR_0">protobuf</span> encoding format for a while and really liked it.  But I did not really like the Java implementation that Google had published.  It was kinda clunky to use and I saw several optimizations that could be used that were missing.  Optimizations that could create huge performance wins when applied to the usage patterns of an enterprise messaging system like <a href="http://activemq.apache.org/" onclick="pageTracker._trackPageview('/outgoing/activemq.apache.org/?referer=');">Apache <span class="blsp-spelling-error" id="SPELLING_ERROR_1">ActiveMQ</span></a>.  So I created<a href="http://svn.apache.org/repos/asf/activemq/sandbox/activemq-flow/activemq-protobuf/" onclick="pageTracker._trackPageview('/outgoing/svn.apache.org/repos/asf/activemq/sandbox/activemq-flow/activemq-protobuf/?referer=');"> a new <span class="blsp-spelling-error" id="SPELLING_ERROR_2">protobuf</span> implementation</a> in the <span class="blsp-spelling-error" id="SPELLING_ERROR_3">ActiveMQ</span> project.</p>
<p>Naturally, I was curious to see how the <span class="blsp-spelling-error" id="SPELLING_ERROR_4">activemq</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_5">protobuf</span> implementation stacked up against similar technologies.  So I grabbed the V1 benchmark source code and added our implementation to it.  If you want to do the same, apply <a href="http://code.google.com/p/thrift-protobuf-compare/issues/detail?id=8" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/thrift-protobuf-compare/issues/detail?id=8&amp;referer=');">this patch</a>.</p>
<p>Once I ran the benchmark and I was very pleased with the results.  I&#8217;m including the performance graphs of our <span class="blsp-spelling-error" id="SPELLING_ERROR_6">impl</span> and standard <span class="blsp-spelling-error" id="SPELLING_ERROR_7">protobuf</span> and thrift for comparison.</p>
<p><img src="http://chart.apis.google.com/chart?chtt=timeCreate&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:246.79,208.72,304.14&amp;chds=0,506&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p><img src="http://chart.apis.google.com/chart?chtt=timeSer&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:3087.0,3121.5,3205.0&amp;chds=0,6274&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p><img src="http://chart.apis.google.com/chart?chtt=timeDSer&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:53.5,3231.0,1936.5&amp;chds=0,3480&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p><img src="http://chart.apis.google.com/chart?chtt=totalTime&amp;chf=c%7C%7Clg%7C%7C0%7C%7CFFFFFF%7C%7C1%7C%7C76A4FB%7C%7C0%7Cbg%7C%7Cs%7C%7CEFEFEF&amp;chs=400x100&amp;chd=t:3387.29,6561.219999999999,5445.639999999999&amp;chds=0,10262&amp;chxl=0:%7Cprotobuf%7Cthrift%7Cactivemq%20protobuf&amp;lklk&amp;chdlp=t&amp;chco=660000%7C660033%7C660066%7C660099%7C6600CC%7C6600FF%7C663300%7C663333%7C663366%7C663399%7C6633CC%7C6633FF%7C666600%7C666633%7C666666&amp;cht=bhg&amp;chbh=10&amp;chxt=y&amp;nonsense=aaa.png" /></p>
<p>As it turns out, our implementation looks <span class="blsp-spelling-corrected" id="SPELLING_ERROR_8">awesome</span> in the benchmark! How about that decoding<span class="blsp-spelling-error" id="SPELLING_ERROR_9"></span> speed!</p>
<p>It&#8217;s getting late here.. so I&#8217;ll have do a follow up post explaining how come we did so much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/09/the-activemq-protobuf-implementation-rocks/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Jansi &#8211; Bringing ANSI Support to Java on Windows</title>
		<link>http://hiramchirino.com/blog/2009/07/jansi-bringing-ansi-support-to-java-on-windows/</link>
		<comments>http://hiramchirino.com/blog/2009/07/jansi-bringing-ansi-support-to-java-on-windows/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 14:37:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[ansi]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2009/07/jansi-bringing-ansi-support-to-java-on-windows/</guid>
		<description><![CDATA[Last weekend I got a little spare time an through together a small little library while should help with the problem of boring Java console applications on Windows.
It&#8217;s called Jansi and it provides support for using ANSI escape sequences in your Java console applications on Windows.
With ANSI escape sequences, you can fully control the the [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I got a little spare time an through together a small little library while should help with the problem of boring Java console applications on Windows.
<p>It&#8217;s called <a href="http://jansi.fusesource.org/" onclick="pageTracker._trackPageview('/outgoing/jansi.fusesource.org/?referer=');">Jansi</a> and it provides support for using <a href="http://en.wikipedia.org/wiki/ANSI_escape_code" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/ANSI_escape_code?referer=');">ANSI escape sequences</a> in your Java console applications on Windows.
<p>With ANSI escape sequences, you can fully control the the cursor positioning and the foreground and background color of the console text output.  Here is quick example of what&#8217;s posssible:
<p><img src="http://jansi.fusesource.org/images/after-jansi-jna-windows.png"/></p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2009/07/jansi-bringing-ansi-support-to-java-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep an eye out for ZooKeeper</title>
		<link>http://hiramchirino.com/blog/2008/07/keep-an-eye-out-for-zookeeper/</link>
		<comments>http://hiramchirino.com/blog/2008/07/keep-an-eye-out-for-zookeeper/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 19:04:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Integration]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[zookeeper]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2008/07/keep-an-eye-out-for-zookeeper/</guid>
		<description><![CDATA[Wow, I love the simplicity that ZooKeeper brings to a really hard set of distributed problems.  Check out this Introductory Video that explains it more in depth.  Basically group leadership/coordination and cluster wide configuration issues are taken care of if you Use ZooKeeper. 
Oh and it&#8217;s an Apache Project now.  Yay!  [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, I love the simplicity that ZooKeeper brings to a really hard set of distributed problems.  Check out this <a href="http://developer.yahoo.com/blogs/hadoop/2008/03/intro-to-zookeeper-video.html" onclick="pageTracker._trackPageview('/outgoing/developer.yahoo.com/blogs/hadoop/2008/03/intro-to-zookeeper-video.html?referer=');">Introductory Video</a> that explains it more in depth.  Basically group leadership/coordination and cluster wide configuration issues are taken care of if you Use ZooKeeper. </p>
<p>Oh and it&#8217;s an Apache Project now.  Yay!  Seems like the project website is still not fully setup since they are migrating from SourceForge to Apache, be here&#8217;s a link to the <a href="https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk" onclick="pageTracker._trackPageview('/outgoing/svn.apache.org/repos/asf/hadoop/zookeeper/trunk?referer=');">source tree</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2008/07/keep-an-eye-out-for-zookeeper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Problems with Geronimo and RTC</title>
		<link>http://hiramchirino.com/blog/2006/06/problems-with-geronimo-and-rtc/</link>
		<comments>http://hiramchirino.com/blog/2006/06/problems-with-geronimo-and-rtc/#comments</comments>
		<pubDate>Sat, 17 Jun 2006 16:20:00 +0000</pubDate>
		<dc:creator>Hiram Chirino</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[geronimo]]></category>

		<guid isPermaLink="false">http://hiramchirino.com/wordpress/2006/06/problems-with-geronimo-and-rtc/</guid>
		<description><![CDATA[The Apache Geronimo project has recently changed it&#8217;s commit policy to a Review then Commit (RTC) policy.  Which means no one can commit to the Geronimo project unless you submit a patch and then get 3 other Geronimo committers to review, apply, test, and then give you 3 +1s.
In theory, this is supposed to [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://geronimo.apache.org/" onclick="pageTracker._trackPageview('/outgoing/geronimo.apache.org/?referer=');">Apache Geronimo</a> project has recently changed it&#8217;s commit policy to a Review then Commit (RTC) policy.  Which means no one can commit to the Geronimo project unless you submit a patch and then get 3 other Geronimo committers to review, apply, test, and then give you 3 +1s.</p>
<p>In theory, this is supposed to increase the communication between the developers.  In practice, it&#8217;s looking a little scary.  For example, I just wanted to move some ActiveMQ integration modules from living in the ActiveMQ project to live in the Geronimo project.  Now, before I submitted the patch, everyone agreed that it was good idea.  I submitted the patch and now I have been waiting 12 days to get enough +1s.</p>
<p>Why is it taking so long?  I think it&#8217;s because the Geronimo project is bigger than what anybody knows.  But we are lucky to have a large developer base that is specialized in different areas of the server.  This specialization is what allows us to produced a server with high quality parts that in turn give us a high quality server.  I don&#8217;t go wasting time figuring how what&#8217;s the best way to implement a Transaction Manager or Deployment system, because I trust the guys that are already working on those pieces.</p>
<p>With the RTC policy, if I we want to get Transaction Manager patch in, folks that might not know ANYTHING about Transaction Manager are going to be looking at those patch and pretending they understand what&#8217;s going on and then giving the +/- 1&#8217;s.  The same thing goes for the developer tooling, JMS Messaging, etc. etc.</p>
<p>I guess in the long run, it may be good that folks get to know other Geronimo systems besides what they specialize in, but in short term, your going to slow down your development model by at least a factor of 10 (I&#8217;ve already been waiting over 10 days to do something that used to take me 10 seconds).  Furthermore, since Geronimo is playing feature catch up, most developers already have enough on their plates, I doubt they also want to review and test other folks patches x3 if the previous development pace is to be sustained.</p>
]]></content:encoded>
			<wfw:commentRss>http://hiramchirino.com/blog/2006/06/problems-with-geronimo-and-rtc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
