Results 1 to 6 of 6

Thread: Serializables and ObjectMessage support

  1. #1
    Join Date
    Aug 2004
    Posts
    27

    Default Serializables and ObjectMessage support

    Why doesn't SimpleMessageConverter support Serializable objects via the ObjectMessage type? Is this just something that hasn't been implemented yet or is there a reason to avoid this design?

  2. #2
    Join Date
    Aug 2004
    Posts
    27

    Default

    Code:
    Index: SimpleMessageConverter.java
    ===================================================================
    RCS file: /cvsroot/springframework/spring/src/org/springframework/jms/support/converter/SimpleMessag
    eConverter.java,v
    retrieving revision 1.3
    diff -u -r1.3 SimpleMessageConverter.java
    --- SimpleMessageConverter.java 21 Aug 2004 15:39:46 -0000      1.3
    +++ SimpleMessageConverter.java 25 Aug 2004 17:41:08 -0000
    @@ -74,6 +74,9 @@
                            }
                            return message;
                    }
    +               else if (object instanceof Serializable) {
    +                       return session.createObjectMessage((Serializable) object);
    +               }
                    else {
                            throw new MessageConversionException("Cannot convert object [" + object + "] to JMS message");
                    }
    @@ -103,6 +106,10 @@
                            }
                            return map;
                    }
    +               else if (message instanceof ObjectMessage) {
    +                       ObjectMessage msg = (ObjectMessage) message;
    +                       return msg.getObject();
    +               }
                    else {
                            throw new MessageConversionException("Cannot convert JMS message [" + message + "] to object");
                    }

  3. #3
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    Actually, the initial version of SimpleMessageConverter had support for ObjectMessage. I removed it after Mark argued that serialization was not something to recommend for messaging. I'll get back to him again - from my point of view, I wouldn't mind readding that support.

    Juergen

  4. #4
    Join Date
    Nov 2004
    Posts
    28

    Default

    Quote Originally Posted by Juergen Hoeller
    Actually, the initial version of SimpleMessageConverter had support for ObjectMessage. I removed it after Mark argued that serialization was not something to recommend for messaging. I'll get back to him again - from my point of view, I wouldn't mind readding that support.

    Juergen
    Well,

    After completing some projectts in wich we decided to just put object messages on a message queue, these days i favour XML based messages.
    It gives you better readability on the actual messages in the queue for administration purposes and you avoid the type guid in your classes or if you skip that problems when upgrading the classes of objects allready on the queue...

    So right now i am trying to implement a castor based messageconverter, since we allready use castor in my current project for serialisation en d-serialisation.

    Greetz
    Leo de Blaauw

  5. #5
    Join Date
    Nov 2004
    Posts
    28

    Default

    Quote Originally Posted by lblaauw
    Quote Originally Posted by Juergen Hoeller
    Actually, the initial version of SimpleMessageConverter had support for ObjectMessage. I removed it after Mark argued that serialization was not something to recommend for messaging. I'll get back to him again - from my point of view, I wouldn't mind readding that support.

    Juergen
    Well,

    After completing some projectts in wich we decided to just put object messages on a message queue, these days i favour XML based messages.
    It gives you better readability on the actual messages in the queue for administration purposes and you avoid the type guid in your classes or if you skip that problems when upgrading the classes of objects allready on the queue...

    So right now i am trying to implement a castor based messageconverter, since we allready use castor in my current project for serialisation en d-serialisation.

    Greetz
    Leo de Blaauw

    Ok, done castor is now used to serialize our objects onto JMS queues using the JMSTemplate with a Castor converter, tomorrow i will do the read from the message queue convert stuff

    Let me know if i need to post how

    Greetz
    Leo de Blaauw

  6. #6

    Default

    Quote Originally Posted by Juergen Hoeller View Post
    Actually, the initial version of SimpleMessageConverter had support for ObjectMessage. I removed it after Mark argued that serialization was not something to recommend for messaging. I'll get back to him again - from my point of view, I wouldn't mind readding that support.

    Juergen
    With spring 3, support is their.
    I just tested !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •