9 Replies Latest reply on Mar 3, 2006 12:27 AM by Scott Stark

    HttpInvokers & Data Compression using GZIP streams

    Janardhan Burugupalli Newbie

      HI Jboss ,

      I am using HttpInvoker and its working fine. And recently i read about the CompressionSocketFactory used in case of JRMPInvoker.

      But i have an idea to use the GZIPOutputStream and GZipInputStream in the httpInvokers.Please tell me if the idea itself is wrong or right or if it has some draw backs which i dont know yet.

      I changed the following and i am adding only the interested lines of code and not the full class

      org.jboss.invocation.http.servlet.InvokerServlet.java

      ServletInputStream sis = request.getInputStream();
      GZIPInputStream tGZIPIn = new GZIPInputStream(sis);
      ObjectInputStream ois = new ObjectInputStream(tGZIPIn);

      ServletOutputStream sos = response.getOutputStream();
      GZIPOutputStream tGZIPOut = new GZIPOutputStream(sos);
      ObjectOutputStream oos = new ObjectOutputStream(tGZIPOut);

      and in the client side i changed the Util.java in the package
      org.jboss.invocation.http.interfaces.Util.java
      OutputStream os = conn.getOutputStream();
      GZIPOutputStream tGZIPOut = new GZIPOutputStream(os);
      ObjectOutputStream oos = new ObjectOutputStream(tGZIPOut);

      InputStream is = conn.getInputStream();
      GZIPInputStream tGZIPIn = new GZIPInputStream(is);
      ObjectInputStream ois = new ObjectInputStream(tGZIPIn);
      MarshalledValue mv = (MarshalledValue) ois.readObject();

      so packed it to the jbossall-client.jar and used it in the client
      so it seems that everything is working fine. But i dont know at all if it is the right thing to do.

      HI scott if u r there and viewed this topic please send ur comments ...as u r the author if this..of course other guys can also comment on this as well

      regards
      Jani