You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Hiram Chirino <hi...@hiramchirino.com> on 2006/03/01 19:26:17 UTC

Recent OpenWire changes

Hi Everybody,

Just a quick heads up,  openwire by default tries to encode commands  
as tight as possible on the wire to decrease bandwidth requirements.   
To do this, it currently uses a 2 pass algorithm where the first pass  
collects all boolean writes into a bit array and pre calculates the  
size of the command on the wire.  The second pass writes the command  
to the stream.

While this produces small on the wire size, it's  a bit CPU  
intensive, so I made a change so that a loose encoding is also  
possible which marshals the messages in a single pass and avoids  
doing all the fancy things that the tight encoding was using.  Using  
loose encoding should make sense if your broker is CPU bound and  
network bandwidth is not an issue.  So if you look at the open wire  
classes you will now see a bunch of tightMarshal/Unmarshal and  
looseMarshal/Unmarshal methods.

Another option that has been added is the ability to omit the command  
size prefix on the serialized commands.  The command size prefix is  
actually only useful for non blocking implementations where we only  
want to unmarshal the command once it has been fully received.  In  
normal blocking IO, knowing the size of the command in not  
necessary.  By omitting the command size, we should be able to do  
more efficient marshaling of the command since we don't have to  
calculate the command size beforehand.

These default options are still at what they were before (tight  
encoding and command size prefixing), but they can be negotiated  
between the client and server with the WireFormatInfo packet.

Regards,
Hiram