activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Co <...@exist.com>
Subject Re: Use of ObjectMessageSerializationDefered
Date Fri, 27 Oct 2006 21:27:49 GMT
I'm not sure if it should work or not. But maybe you can try setting 
copyMessageOnSend to false.

brodyc wrote:
> 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
>
>   


Mime
View raw message