activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bob.deremer" <>
Subject URGENT QUESTION: AMQ 5.3.0 bug or configuration error??? - ObjectMessage is [still] being serialized when using setObjectMessageSerializationDefered and setCopyMessageOnSend
Date Fri, 19 Feb 2010 15:56:26 GMT

I'm sorry for the extremely URGENT nature of this question, but I believe
I've either come across a bug in AMQ 5.3.0 or I need additional
configuration settings.  I have multiple POJO(s) that are using an embedded
ActiveMQ broker via "vm" access.  They are sending custom objects around as
the payload of the event messages and we [cannot] have them being

I have listed the problem, my debugging steps so far, and my code for
creating connections - in case I'm missing something.  I'm hoping that this
is a matter of me needing to do some extra configuration, so please advise! 

Thanks in advance,


ObjectMessage(s) are [still] being serialized even after setting
setObjectMessageSerializationDefered = true and setCopyMessageOnSend = false
on my ActiveMQConnectionFactory object.

To verify that the instructions on the ActiveMQ site regarding disabling
ObjectMessage serialization are correct, I decided to implement
Externalizable on one of my custom classes that are in the object being put
in the ObjectMessage.  

I was very surprised to see that when the ObjectMessage is sent via
MessageProducer.send(om) - it is being serialized!  And, when the
ObjectMessage is dispatched into the MessageConsumer's onMessage, it is
being de-serialized.

So, I set a breakpoint in my readExternal and writeExternal methods.  The
code that is serializing the ObjectMessage is in: activemq-5.3.0 source: [lines 1662 - 1667].  I've listed them below.  It
even talks about copying the message in case an embedded broker is
dispatching via vm:// - which is confusing to me.

                        if (dispatcher != null) {
                            // Copy in case a embedded broker is dispatching
                            // vm://
                            // md.getMessage() == null to signal end of
                            // browse.
                            Message msg = md.getMessage();
                            if (msg != null) {
                                msg = msg.copy();

I'm creating an embedded broker and creating connections from an
ActiveMQConnectionFactory instance that is using the URL =
"vm://MyEmbeddedBroker".  The code looks like the following.  I am then
creating a connection from this, which is then used for creating my
MessageProducer(s) and MessageConsumer(s).

        private String user = ActiveMQConnection.DEFAULT_USER;
        private String password = ActiveMQConnection.DEFAULT_PASSWORD;
        private String url = "vm://MyEmbeddedBroker";	
	private ActiveMQConnectionFactory connectionFactory;

        this.connectionFactory = new ActiveMQConnectionFactory(user,
password, url);

        // set these so the object is NOT serialized when sending messages

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message