activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tarek Hammoud (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-2622) ObjectMessage is [still] being serialized and de-serialized when using setObjectMessageSerializationDefered and setCopyMessageOnSend in local vm:// scenario
Date Wed, 02 Jun 2010 23:04:53 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-2622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59648#action_59648
] 

Tarek Hammoud commented on AMQ-2622:
------------------------------------

Hi, I tested this fix and encountered a case where this mechanism does not seem to work properly.
Here is the scenario we have:

A server that has a producer. The producer communicates with the local broker using the vm://.
There are local consumers that listen on the topic being published to in the same VM. All
consumers that are local in the same VM work as advertised without any serialization thanks
to this fix. 

Here is the problem:

Remote consumers communicate to the broker using TCP for the same topic. When the producer
sends the message to the destination, it is being sent over the vm:// and ObjectMessage has
content set to null and a valid object. The broker then tries to send the message to the remote
client with null contents causing errors.

It seems that perhaps, ObjectMessage should override getContent() to detect this situation.
i.e if object != null and content is null, then serialize first and then return the content.
I am sure you have a better solution to this issue. Thanks.

> ObjectMessage is [still] being serialized and de-serialized when using setObjectMessageSerializationDefered
and setCopyMessageOnSend in local vm:// scenario
> ------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2622
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2622
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.3.0
>         Environment: 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)
>            Reporter: Bob DeRemer
>            Assignee: Gary Tully
>             Fix For: 5.4.0
>
>         Attachments: unit-test.txt
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message