In terms of JMS performance, I have read that ObjectMessage should be avoided for performance reasons.
How bad are ObjectMessage performance-wise? Should I serialize to a BytesMessage and manually deserialize?
In terms of JMS performance, I have read that ObjectMessage should be avoided for performance reasons.
How bad are ObjectMessage performance-wise? Should I serialize to a BytesMessage and manually deserialize?
The performance overhead of ObjectMessage
is because of the java.io
serialization process. If you do that yourself and use ByteMessage
, you're just doing what JMS would do itself, and you'll be no better off.
If you need to send java objects via JMS, you should use ObjectMessage
, that's what the API provides. This allows the container to make some optimizations, e.g. JBoss will use its own proprietary serialization protocol, which is considerably faster than the standard java.io
one.