[activemq-user] Exchange ObjectMessages between Java&C?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[activemq-user] Exchange ObjectMessages between Java&C?

Stefan Frank
Hi,

I'm new to activeMQ and just started to browse through the docs, so this is
maybe an easy question that can be answered by pointing me to the right
place in the docs: Is it possible to exchange ObjectMessages between
different languages?! I've looked through the docs but I did not yet find
any hints on serialization into a language-neutral format and de-serializing
things into different languages  - is that out of the Scope of ActiveMQ? And
if it is, has anybody any experience with manual
serialization/deserialization and then shipping this as ByteMessages?!

Cheers
stefan

Reply | Threaded
Open this post in threaded view
|

Re: [activemq-user] Exchange ObjectMessages between Java&C?

chirino
Hi Stefan,

Serializing an Object is complex and there are many different ways to  
do it.  The standard way in java (and the way that ActiveMQ's  
ObjectMessage works) is to use Object serialization but  
unfortunately, it uses a binary format that other languages may find  
tricky to de-serialize.  Your best bet might be to use XStream which  
serializes the objects as XML and to put that in either a byte or  
text message.

Regards,
hiram

On Nov 24, 2005, at 6:41 AM, Stefan Frank wrote:

> Hi,
>
> I'm new to activeMQ and just started to browse through the docs, so  
> this is
> maybe an easy question that can be answered by pointing me to the  
> right
> place in the docs: Is it possible to exchange ObjectMessages between
> different languages?! I've looked through the docs but I did not  
> yet find
> any hints on serialization into a language-neutral format and de-
> serializing
> things into different languages  - is that out of the Scope of  
> ActiveMQ? And
> if it is, has anybody any experience with manual
> serialization/deserialization and then shipping this as ByteMessages?!
>
> Cheers
> stefan
>

Reply | Threaded
Open this post in threaded view
|

RE: [activemq-user] Exchange ObjectMessages between Java&C?

Stefan Frank
Hello Hiram,

Unfortunately, that was exactly what I was trying to avoid. We have huge
object-graphs that we want to transmit, and the effort to
marshall/unmarshall things into/from XML singnificantly effects our
performance (because of XML overhead, memory-consumption, encoding, etc.) -
so we are currently looking for binary formats, that may be a bit more
propriertary, but faster. Apart from ICE (http://zeroc.com) we did not find
too much yet. But ICE is far too proprietary and too hard to integrate with
common infrastructure (it basically tries to replace all infrastructure with
proprietary stuff) - so ActiveMQ&a decent, crossplattfrom
serializer/deserializer would be a good fit (or, please, correct me, if this
idea is completely queer)

Thx
stefan

> -----Original Message-----
> From: Hiram Chirino [mailto:[hidden email]]
> Sent: Donnerstag, 24. November 2005 14:47
> To: [hidden email]
> Subject: Re: [activemq-user] Exchange ObjectMessages between Java&C?
>
> Hi Stefan,
>
> Serializing an Object is complex and there are many different
> ways to do it.  The standard way in java (and the way that
> ActiveMQ's ObjectMessage works) is to use Object
> serialization but unfortunately, it uses a binary format that
> other languages may find tricky to de-serialize.  Your best
> bet might be to use XStream which serializes the objects as
> XML and to put that in either a byte or text message.
>
> Regards,
> hiram
>
> On Nov 24, 2005, at 6:41 AM, Stefan Frank wrote:
>
> > Hi,
> >
> > I'm new to activeMQ and just started to browse through the docs, so
> > this is maybe an easy question that can be answered by
> pointing me to
> > the right place in the docs: Is it possible to exchange
> ObjectMessages
> > between different languages?! I've looked through the docs
> but I did
> > not yet find any hints on serialization into a
> language-neutral format
> > and de- serializing things into different languages  - is
> that out of
> > the Scope of ActiveMQ? And if it is, has anybody any
> experience with
> > manual serialization/deserialization and then shipping this as
> > ByteMessages?!
> >
> > Cheers
> > stefan
> >
>

Reply | Threaded
Open this post in threaded view
|

RE: [activemq-user] Exchange ObjectMessages between Java&C?

Max Kington
In reply to this post by Stefan Frank
Hi Stefan,

As Hiram points out the object serialization lark can be quite a tricky
beast.  Once you've decided how you're going to talk about the bytes you
then have to describe object structure. You might have to look a bits of
CORBA to find something that isn't proprietary.  It kind of depends how
proprietary is not too proprietary.  You can for instance take the
contract for DataInput/OutputStreams in Java and port those, but once
you're done with moving bytes you'll need to describe your graphs.  The
other thing is consider ASN.1, commercial compilers exist which should
make short work the marshalling work but should interoperate with other
ASN.1 savvy tools.  Make sure you select the right encoding for your
uses, BER, DER, etc, etc.

Out of interest, just how big are your objects, both in hierarchy and
bytes?

Regards,
Max

-----Original Message-----
From: Stefan Frank [mailto:[hidden email]]
Sent: 24 November 2005 14:26
To: [hidden email]
Subject: RE: [activemq-user] Exchange ObjectMessages between Java&C?


Hello Hiram,

Unfortunately, that was exactly what I was trying to avoid. We have huge
object-graphs that we want to transmit, and the effort to
marshall/unmarshall things into/from XML singnificantly effects our
performance (because of XML overhead, memory-consumption, encoding,
etc.) - so we are currently looking for binary formats, that may be a
bit more propriertary, but faster. Apart from ICE (http://zeroc.com) we
did not find too much yet. But ICE is far too proprietary and too hard
to integrate with common infrastructure (it basically tries to replace
all infrastructure with proprietary stuff) - so ActiveMQ&a decent,
crossplattfrom serializer/deserializer would be a good fit (or, please,
correct me, if this idea is completely queer)

Thx
stefan

> -----Original Message-----
> From: Hiram Chirino [mailto:[hidden email]]
> Sent: Donnerstag, 24. November 2005 14:47
> To: [hidden email]
> Subject: Re: [activemq-user] Exchange ObjectMessages between Java&C?
>
> Hi Stefan,
>
> Serializing an Object is complex and there are many different
> ways to do it.  The standard way in java (and the way that
> ActiveMQ's ObjectMessage works) is to use Object
> serialization but unfortunately, it uses a binary format that
> other languages may find tricky to de-serialize.  Your best
> bet might be to use XStream which serializes the objects as
> XML and to put that in either a byte or text message.
>
> Regards,
> hiram
>
> On Nov 24, 2005, at 6:41 AM, Stefan Frank wrote:
>
> > Hi,
> >
> > I'm new to activeMQ and just started to browse through the docs, so
> > this is maybe an easy question that can be answered by
> pointing me to
> > the right place in the docs: Is it possible to exchange
> ObjectMessages
> > between different languages?! I've looked through the docs
> but I did
> > not yet find any hints on serialization into a
> language-neutral format
> > and de- serializing things into different languages  - is
> that out of
> > the Scope of ActiveMQ? And if it is, has anybody any
> experience with
> > manual serialization/deserialization and then shipping this as
> > ByteMessages?!
> >
> > Cheers
> > stefan
> >
>


________________________________________________________________________
In order to protect our email recipients, Betfair use SkyScan from
MessageLabs to scan all Incoming and Outgoing mail for viruses.

________________________________________________________________________

Reply | Threaded
Open this post in threaded view
|

RE: [activemq-user] Exchange ObjectMessages between Java&C?

Tatu Saloranta
In reply to this post by Stefan Frank
Stefan Frank <[hidden email]> wrote: Hello Hiram,

Unfortunately, that was exactly what I was trying to avoid. We have huge
object-graphs that we want to transmit, and the effort to
marshall/unmarshall things into/from XML singnificantly effects our
performance (because of XML overhead, memory-consumption, encoding, etc.) -
so we are currently looking for binary formats, that may be a bit more

 Stefan, although there is some overhead in doing XML in general, using streaming parser/serializers this overhead in general is much lower than what people consider "typical XML parsing overhead" to be. Memory usage of XML-specific part is only proportional to the depth of the hierarchy, and mostly nominal; and the other parts (bookkeeping to resolve entity identity etc) are independent of wire format.
 From my limited tests using a streaming parser (Woodstox StAX parser), my results indicated that of total parsing time when reading XML from a file (normal PC work station, Ultra-66 IDE, linux), almost 40% of time was spent on raw I/O.
 Since parsing binary encoding has its own overhead too, it may be worth considering XML serialization using streaming alternatives (SAX, StAX..).
 XML overhead may be much less than what you are expecting.
 
 There are also newer plans with Fast Infoset (binary encoding of XML) that might be of interest as well.
 
 Anyway, I just thought I'll mention above since many people base their measurements on using full DOM parsers, and that gives lousy results for tasks where non-memory-resident processing would be possible and significantly faster (3x - 5x faster just for parsing, for sizable documents).
 
 For what it's worth, StAX parsers are used a lot for data serialization purposes (Soap, XML-to-Object binding).
 
 -+ Tatu +-
 


               
---------------------------------
 Yahoo! Personals
 Single? There's someone we'd like you to meet.
 Lot's of someone's, actually. Try Yahoo! Personals