You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by William Blackburn <wj...@mac.com> on 2006/10/26 23:00:26 UTC

Objects attached to normalized messages as properties

Among other things, I am using servicemix as an asynchronous backbone  
between several internal application components. I use jms flow with  
amq and servicemix configured for persistent messages. These  
components operate on a number of shared objects. I had created a  
serializer to serialize these objects as XML instance documents  
(DOMSources) which complied with the types section of the wsdl for  
each component.

I've found a noticeable performance gain if I just relay the objects  
as-is between the components (as object-properties of the message),  
as opposed to transforming them to/from xml. This is OK, because  
these components are entirely internal and so don't need to behave in  
a traditional JBI-ish way.

But I'm worried that this may not be a 'best-practice'. Specifically,  
support for arbitrary objects as message properties is not specified  
in JMS, it appears to be introduced by servicemix (and what a great  
feature it is!). Am I doing something that will cause problems with  
persisting my message? Are there any other reasons I shouldn't be  
doing this? It seems to work just fine, but I really need to be certain.

Thanks as always,

BJ

Re: Objects attached to normalized messages as properties

Posted by Guillaume Nodet <gn...@gmail.com>.
You can put anything you want in message properties,
else the API would use String in properties instead of
objects.  The only thing i'm not quite sure about, is wether
it is really allowed to put nothing in the content of the message.

The other way would be to create an extended DOMSource
implementation which can serialize the object as xml if needed,
while still allowing the object to be retrieved, as done in
 http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/JavaSource.java?view=markup

It would be more JBI compliant, while still allowing to pass objects
without serializing them as xml if not needed.

On 10/26/06, William Blackburn <wj...@mac.com> wrote:
> Among other things, I am using servicemix as an asynchronous backbone
> between several internal application components. I use jms flow with
> amq and servicemix configured for persistent messages. These
> components operate on a number of shared objects. I had created a
> serializer to serialize these objects as XML instance documents
> (DOMSources) which complied with the types section of the wsdl for
> each component.
>
> I've found a noticeable performance gain if I just relay the objects
> as-is between the components (as object-properties of the message),
> as opposed to transforming them to/from xml. This is OK, because
> these components are entirely internal and so don't need to behave in
> a traditional JBI-ish way.
>
> But I'm worried that this may not be a 'best-practice'. Specifically,
> support for arbitrary objects as message properties is not specified
> in JMS, it appears to be introduced by servicemix (and what a great
> feature it is!). Am I doing something that will cause problems with
> persisting my message? Are there any other reasons I shouldn't be
> doing this? It seems to work just fine, but I really need to be certain.
>
> Thanks as always,
>
> BJ
>


-- 
Cheers,
Guillaume Nodet