Message Data Compression
I'm not exactly new to java, I've just been away from it for a few years.
I'm trying to create an XML-based messaging system for communication between a suite of applications. XML being what it is (verbose text) I want to apply data compression. (In the short term, during development, the messages will be between components on a single machine. Ultimately, the applications will likely run on many machines and use the internet to communicate with each other.)
I was looking at the java.util.zip tools, but I'm not actually creating files. I thought I could use just the ZipEntry part, but it's not coming together well. I was also thinking some flavor of SOAP might serve my needs, but SOAP has come onto the scene during my absence from development activities. I've got to familiarize myself with it a bit more before I can assess whether or not it fits my needs.
I'm open to suggestions as to how I should approach this. All ideas anyone cares to share are greately appreciated.
- Patrick
[1031 byte] By [
P_Hagertya] at [2007-11-27 10:51:26]

How are you exchanging the messages between applications? Is it:
HTTP, RMI, JMS, File I/O?
Is your messaging system going to support communication across platforms i.e. .NET/J2EE/legacy etc.? I guess a useful answer or discussion on this problem needs little more information on the problem you are trying to solve.
Regards
The system will probably use a combination of RMI and JMS, but that's not anything I want to bring into the question at hand.
The only problem I'm concerned about right now is, "How do I compress a packet of data?" What I do with that packet of compressed data is a problem for a different level of abstraction. I've got a fairly large buffer of XML that I want to compress before passing off to another entity to act upon. What's the best way to do that?
- Patrick
I've looked at the API data for GZIPInputStream and GZIPOutputStream and these look promising. Can someone point me to some online code examples to study? (I've got the Java Examples book, but it's burried in a box somewhere. I've just moved for a new job from CT to Washington state just north of Seattle. Many of my books are still in boxes.)
Your help and advice has been greatly appreciated.
- Patrick