jms serialization

G

g_asi2

Hi,

I am new to JMs, and I would like to ask if serialization is performed
always?
I mean that if the components which use the queue are remote, it is
obvious that serialize commited when inserting the queue, and
deserialize commited when dequeuing.
But if the two components aren't remote (even same process), is JMS
"smart enough" not to serialize?

Thanks,
Asi
 
W

Wesley Hall

g_asi2 said:
Hi,

I am new to JMs, and I would like to ask if serialization is performed
always?
I mean that if the components which use the queue are remote, it is
obvious that serialize commited when inserting the queue, and
deserialize commited when dequeuing.
But if the two components aren't remote (even same process), is JMS
"smart enough" not to serialize?

Thanks,
Asi

This will depend on your JMS broker. If you are using JMS where the
broker, the sender and the receiver are all in the same process then I
don't see why the broker should need to serialize the message. However,
many broker will just use standard 'generalised' code to handle messages
which may include serialization. Given that using an 'in process' JMS
broker to send messages is a very rare case (overkill!) then it is
probably unreasonable to expect broker providers to allow for this
specific case.

The only way to know for sure would be to write a test case, provide a
writeObject in your serializable class and print a message to the
console. If the message prints, it is serializing.
 
E

EJP

If I was implementing a JMS provider I would always use serialization
and avoid the 'optimization' so that I could preserve the correct
semantics. If I avoided serialization in the in-memory case, a
subsequent change to one of the (non-)serialized objects at the sender
would be reflected at the receiver, and that's certainly not the
intention of the JMS specification.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top