activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brodyc <cwik...@us.ibm.com>
Subject Use of ObjectMessageSerializationDefered
Date Fri, 27 Oct 2006 20:10:01 GMT

Is there a way to send a message that contains an object which does not
implement Serializable when using integrated broker (
brokerURL=vm://localhost).

I read this on ActiveMQ website:

"Disabling Object serialization with ObjectMessage for ActiveMQ 4.x
=========================================
The JMS specification dictates that the body of an ObjectMessage must be
serialized when you call send() to avoid the object changing under your feet
affecting what view the consumer sees of the object.

You can disable the automatic serialization of ObjectMessage payloads so
that the objects are passed by value in 4.x by setting the
objectMessageSerializationDefered flag to true on the
ActiveMQConnectionFactory (or ActiveMQConnection)."

I thought that I could wrap my non-serializable object in a Serializable
envelope object and pass it on. Perhaps I am just naive to expect it to work
but the documentation led me to believe that this may be possible. When I
try this approach I get java.io.NotSerializableException

I use ActiveMQ 4.0.1 and Spring. My spring xml defines the factory as
follows:

<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
> 
        <property name="brokerURL"
value="vm://localhost?broker.objectMessageSerializationDefered=true"/> 
    </bean>

Thanks, jc

-- 
View this message in context: http://www.nabble.com/Use-of-ObjectMessageSerializationDefered-tf2522832.html#a7037470
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message