Announcement Announcement Module
Collapse
No announcement yet.
Serializables and ObjectMessage support Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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");
                    }

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          Originally posted by lblaauw
          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

          Comment


          • #6
            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 !

            Comment

            Working...
            X