-
1. Re: Alternatives to ObjectMessage
rnicholson10 Sep 12, 2009 11:53 AM (in response to rnicholson10)The reason I ask is that we will starting perfomance testing next week. I'd like to be able to try an alternative to ObjectMessage and measure the performance differences.
-
2. Re: Alternatives to ObjectMessage
clebert.suconic Sep 12, 2009 11:56 PM (in response to rnicholson10)Really the best is you doing your own marshalling and putting everything as Bytes into a BytesMessage. (or depending on the size, on a Largemessage (see the large message chapter)).
On the server's side, the Objectmessage is just a Message with a ByteArray as a body. But I guess I have seen you mentioning you're using those ObjectMessages on the Server's side (such as JSPs, servlets.. etc). -
3. Re: Alternatives to ObjectMessage
timfox Sep 13, 2009 4:14 AM (in response to rnicholson10)"clebert.suconic@jboss.com" wrote:
Really the best is you doing your own marshalling and putting everything as Bytes into a BytesMessage. (or depending on the size, on a Largemessage (see the large message chapter)).
That's unnecessary.
All the JMS Object types, MapMessage, StreamMessage, TextMessage, BytesMessage *apart* from ObjectMessage do not use Java serialization, and have a compact and efficient encoding and wireformat size.
So, the short answer is, if you're using JMS, using any type other than ObjectMessage is good. -
4. Re: Alternatives to ObjectMessage
timfox Sep 13, 2009 7:01 AM (in response to rnicholson10)If you use, say, Map message, make sure you only put basic types String, int, long, boolean etc.
If you put arbitrary java objects, of course that will use Java serialization too! -
5. Re: Alternatives to ObjectMessage
timfox Sep 13, 2009 7:05 AM (in response to rnicholson10)Ah duh! MapMessage will only let you put the basic types anyway - you can't put arbitrary objects so ignore my last comment.
-
6. Re: Alternatives to ObjectMessage
jhakim Dec 1, 2009 2:15 PM (in response to rnicholson10)Tim - your last comment is spot on for an enhancement request of mine. We use TIBCO EMS, ActiveMQ, and Messageforge for a very successful bond trading platform. Both EMs and ActiveMQ provide extensions that allow a MapMessage to contain structured data - EMS allows nested MapMessage and ActiveMQ allows nested Map. The power of nested (recursive) structured data is immense.
Would HornetQ consider providing such an extension? -
7. Re: Alternatives to ObjectMessage
timfox Dec 1, 2009 5:46 PM (in response to rnicholson10)We could do this, but the down side to it, is it encourages lazy practices by developers.
As soon as we accept an arbitrary serializable object to be added, then typically developers will throw in the kitchen sink and expect it to be serialized efficiently.
If you don't care about performance, then serializing hierarchies of nested objects can be done, but it will be slow.
It is usually far more efficient for developers to intelligently martial their data using the other message types and not relying on Object serialization.