The moose likes Performance and the fly likes JMS Performance Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "JMS Performance" Watch "JMS Performance" New topic
Author

JMS Performance

Venkateswara Rao
Greenhorn

Joined: Oct 20, 2001
Posts: 24
Is there any performance difference between sending ObjectMessage and TextMessage of same size to JMS Queue. TextMessage contains just xmlstring only, but ObjectMessage contains lot of other objects and primitive data types.
Here keep in mind the contents of TextMessage object is same as ObjectMessage object. May be size also same.
I am waiting for your reply
Thanks and Regards
Venkateswara Rao
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
Sending an ObjectMessage would be sort of like using serizlized bytes instead of xml in a TextMessage. I'm not too familiar with the JMS specs but it may be possible for a JMS provider to pass the object directly in memory without ever serializing it, which could possible change the equation depending on your specific software setup.
You might want to write a few tests to see if you can (de)serialize to XML as fast as ObjectOut/InputStream (de)serializes. I would guess that XML has more overhead, but you might be able to counter the fact that ObjectOutputStream needs to use reflection and figure stuff out at runtime.
The other issue is memory. Serialized objects should be packed pretty efficiently in binary, but it's possible that you could end up storing unnecessary data and/or run into object version incompatability problems.
I suggest that you do a few quick test to compare the speed and memory requirements of each option. If there isn't a big performace difference, I'd be inclined to go with XML just because it's more adaptable and extensible.
 
 
subject: JMS Performance
 
Threads others viewed
how to use two execute queues for one servlet
Exception in receiving ObjectMessage in JMS
JMS question
RE: Receiveing ObjectMessage in JMS
Simple Question regarding JMS
developer file tools