jms serialization

Discussion in 'Java' started by g_asi2, Dec 10, 2006.

  1. g_asi2

    g_asi2 Guest

    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
     
    g_asi2, Dec 10, 2006
    #1
    1. Advertising

  2. g_asi2

    Wesley Hall Guest

    g_asi2 wrote:
    > 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.
     
    Wesley Hall, Dec 10, 2006
    #2
    1. Advertising

  3. g_asi2

    EJP Guest

    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.
     
    EJP, Dec 10, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Stein
    Replies:
    0
    Views:
    770
    Thomas Stein
    Oct 18, 2004
  2. Replies:
    8
    Views:
    2,259
    deadsea
    Jan 2, 2005
  3. Replies:
    3
    Views:
    1,041
  4. Dimitri Ognibene
    Replies:
    4
    Views:
    786
    Dimitri Ognibene
    Sep 2, 2006
  5. Replies:
    0
    Views:
    431
Loading...

Share This Page