You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by gorca <go...@gmail.com> on 2010/03/25 16:59:38 UTC

Best way to send XML via JMS for POJO Marshalling

I have java producer and consumer. I want to send POJO object between them. I
prefer not use java serialization so other application like .NET can use
server in future. And it's also good when debugging.

I think JMS TextMessage with XML content is best way.

But what is best practice for doing this? I have found many ways and this
forum had reference to Stomp, but I am not sure if this is right way. I also
found POJO to XML packages like Castor and Hibernate also has that feature:

http://www.castor.org/index.html

My classes are simple and just carry simple data with collections of other
classes and pimitive types. Objects are small, probably avg 500 bytes and
worst is 2-3kb. Performance isn't a big concern. Application is ok with
10/msg per sec. What do you recommend as best way?
-- 
View this message in context: http://old.nabble.com/Best-way-to-send-XML-via-JMS-for-POJO-Marshalling-tp28030964p28030964.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Best way to send XML via JMS for POJO Marshalling

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2010-03-25 at 08:59 -0700, gorca wrote:
> I have java producer and consumer. I want to send POJO object between them. I
> prefer not use java serialization so other application like .NET can use
> server in future. And it's also good when debugging.
> 
> I think JMS TextMessage with XML content is best way.
> 
> But what is best practice for doing this? I have found many ways and this
> forum had reference to Stomp, but I am not sure if this is right way. I also
> found POJO to XML packages like Castor and Hibernate also has that feature:
> 
> http://www.castor.org/index.html
> 
> My classes are simple and just carry simple data with collections of other
> classes and pimitive types. Objects are small, probably avg 500 bytes and
> worst is 2-3kb. Performance isn't a big concern. Application is ok with
> 10/msg per sec. What do you recommend as best way?

You could give XStream a try, its quite simple to get started with. See:
http://xstream.codehaus.org/ 

There's some pretty good getting started docs on the site.

Regards

-- 
Tim Bish

Open Source Integration: http://fusesource.com
ActiveMQ in Action: http://www.manning.com/snyder/

Follow me on Twitter: http://twitter.com/tabish121
My Blog: http://timbish.blogspot.com/


Re: Best way to send XML via JMS for POJO Marshalling

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

think XStream (http://xstream.codehaus.org/) is much better option then
Castor nowadays. You simply convert your object to XML and send it as XML
payload.

You can also use XStream message transformer (
http://activemq.apache.org/message-transformation.html), but in your case I
think it's better to do it all by yourself.

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Mar 25, 2010 at 4:59 PM, gorca <go...@gmail.com> wrote:

>
> I have java producer and consumer. I want to send POJO object between them.
> I
> prefer not use java serialization so other application like .NET can use
> server in future. And it's also good when debugging.
>
> I think JMS TextMessage with XML content is best way.
>
> But what is best practice for doing this? I have found many ways and this
> forum had reference to Stomp, but I am not sure if this is right way. I
> also
> found POJO to XML packages like Castor and Hibernate also has that feature:
>
> http://www.castor.org/index.html
>
> My classes are simple and just carry simple data with collections of other
> classes and pimitive types. Objects are small, probably avg 500 bytes and
> worst is 2-3kb. Performance isn't a big concern. Application is ok with
> 10/msg per sec. What do you recommend as best way?
> --
> View this message in context:
> http://old.nabble.com/Best-way-to-send-XML-via-JMS-for-POJO-Marshalling-tp28030964p28030964.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>