RMI client/server network traffic
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   korfut_korfut
Posted On:   Tuesday, April 22, 2003 12:28 PM

Hi,
i built a Swing Client that access a J2EE Server remotely from the internet, i lookup only Stateful and Stateless Session Bean from the client, the results of some method call is for instance:
Product p = session.getProduct(123); //123 is a PK
i use Session Facade Pattern, i noticed that the SessionFacade and the Product objects are less than 3KB, but the total network traffic involves almost 16KB sent and 17KB received.
Why is there all this additional traffic on the network? can someone explain me what is happening? is there a way/strategy to reduce the amount of data sent/received?

Thank you very much.

Re: RMI client/server network traffic

Posted By:   Kambiz_Shahri  
Posted On:   Wednesday, May 14, 2003 08:45 AM



Hi korfut




It does not surprise me that you get more than you expect.
The answer to your question, I think, in 2 words:
"Object Graph".




Returing Product, to the caller, means Serializing the entire
Object Graph of the Product class.




Imagine a tree, where the root is the Product and ALL the
objects that it references as its' member variables, and
all the object that those member variables refer to, and so
on.




When desiging return values, you have to think very carefuly
what it is, you want to return; otherwise, sooner or later,
and depending on the numbers, you could bring your
network down to its knees.




I hope this helps.

About | Sitemap | Contact