0

I have a client which calls several ejb2/ejb3 beans. Some calls send lots of data and thus compression would be very helpful.

How can I enable/implement compression of remote method calls? I use jboss 5.1 and ejb2/ejb3 beans if it is important.

Thank you in advance.

michael nesterenko
  • 14,222
  • 25
  • 114
  • 182

1 Answers1

1

There are two ways I can think of to do this:

  1. Implement your own ServerSocketFactory and wire that into your RMI client and server
  2. Use a VPN network interface that provides compression

Honestly, I'd go with #2 in this case: you shouldn't have to do all the work #1 will require when you can get it for free from a networking component. It will also be more reliable and robust than anything you just hack together.

Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
  • Second option is what I use internally, however it is not possibly to do for production usage (it is out of my control). Is not first option too intrusive? I need to implement compression only for one type of clients (there could be others that does not support compression and they should not be affected). – michael nesterenko Jan 02 '13 at 10:48
  • IMO you need to modify the environmental requirements of your web application such that your network team provides the proper support. If you need a VPN, then demand a VPN: it will be *so much* easier than trying to re-wire all of the RMI stuff. If you change the ServerSocketFactory, then you will modify the RMI behavior for all clients, not just some of them. So you may end up making your server incompatible with a large subset of your clients. – Christopher Schultz Jan 05 '13 at 13:58