In my opinion MapMessage should be the best choice, if you intend to send collections of primitive data type (or their wrappers). First because MapMessages suppose to perform better than ObjectMessage, which adds the serialization extra-cost when passing data across application boundaries. Secondly adding new name-value pairs to the MapMessage is not going to break your code. Another drawback of using ObjectMessage is that it relies on the sender and receiver having the same exact version of the class and sometimes this might be a pain in the b� The only two reasons I�m aware about that should convince one to use the ObjectMessage are to have an object-oriented approach for sending/receiving messages. In your case though, since the object itself is a HashMap, you�re kind of loosing this feature. Another limitation of MapMessage is that you cannot send any type of data, but only primitive and their Java wrappers. Regards.
I think, therefore I exist -- Rene Descartes
Joined: Aug 27, 2003
Joined: Feb 17, 2005
You're very welcome Vishwa
subject: MapMessage vs HashMap in setObjectMessage