Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-2622

ObjectMessage is [still] being serialized and de-serialized when using setObjectMessageSerializationDefered and setCopyMessageOnSend in local vm:// scenario

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.3.0
    • 5.4.1
    • None
    • None
    • Windows Server 2008 R2, 64-bit, binary download of ActiveMQ 5.3.0, Java 1.6.0_17 (64-bit), Eclipse 3.5 (64-bit), tomcat 6.0 (64-bit)

    Description

      I have outlined the problem in the following forum link:

      http://old.nabble.com/URGENT-QUESTION:-AMQ-5.3.0-bug-or-configuration-error------ObjectMessage-is--still--being-serialized-when-using-setObjectMessageSerializationDefered-and-setCopyMessageOnSend-td27654579.html

      I have not created a JUnit test that demonstrates this, but here are the basic steps to reproduce this:

      • create an embedded broker with no persistence, dedicatedTaskRunner = false, and optimizedDispatch = true
      • create the ActiveMQConnectionFactory and set the setObjectMessageSerializationDefered = TRUE and setCopyMessageOnSend = FALSE
      • create your connection from the factory
      • create a producer and [MessageListener] consumer against a Queue
      • create your own custom java object that implements Externalizable - this is important, because you will be able to set a breakpoint in the readExternal and writeExternal methods to see the 2 locations on the AMQ code where the message is copied - causing a serialization/de-serialization
      • create a new ObjectMessage and send it from the producer to the consumer

      The message will get serialized in ActiveMQConnection.java on this line [msg = msg.copy();] - see the linked forum issue for the code snippet and line numbers.

      NOTE: you will need to continue stepping the code through the complete dispatch process because it will go through a de-serialization phase as well when the call to getObject is called in the onMessage of the MessageListener.

      Please let me know if I can provide any more details - OR, if I'm not setting something properly to keep the ObjectMessage from being serialized.

      Thanks,
      Bob

      Attachments

        1. unit-test.txt
          9 kB
          Stanley J. Lewis

        Activity

          People

            gtully Gary Tully
            bob.deremer Bob DeRemer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: