activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: ObjectMessage in C/C++
Date Thu, 05 Nov 2009 14:42:57 GMT
On Wed, 2009-11-04 at 19:20 -0800, thinkbox wrote:
> Hi Nate, I am also in the same situation with Joshua and is currently
> considering ActiveMQ-CPP for my C++ clients to be able to talk to my Java
> components. I am currently using version 2.2.6 of ActiveMQ-CPP, are there
> any updates if ObjectMessages is now supported?
> 

ActiveMQ C++ cannot support ObjectMessage.  The serialized version of a
Java object is not readable by the C++ code, and can't be converted into
a C++ type.  You need to perform some sort of transformation on the
Object before sending to a C++ client, such as converting it to XML and
sending it as a TextMessage, then your C++ code can turn it back into a
C++ object of your own design or just parse the XML for the data you are
after.  A search for C++ XML Binding on Google will give you some
insights into how to accomplish that.  

> Also, say my serialized object is implemented below,
> 
> public class Subscriber implements Serializable {
>     private String name;
>     private int age;
>     
>     ...
> 
>     //setters and getters method follows
> }
> 
> 
> On my C++ code, say I have created an equivalent Subscriber class, can't I
> just cast the returned object of getObject() into Subscriber?
> 
> Thanks,
> Pat
> 
> 
> nmittler wrote:
> > 
> > ActiveMQ-CPP doesn't support ObjectMessages.  If you're stuck sending  
> > ObjectMessages from Java, probably your best bet would be to use a  
> > Camel message translator in the broker
> > (http://activemq.apache.org/camel/message-translator.html 
> > ).
> > 
> > Regards,
> > Nate
> > 
> > On Jul 6, 2008, at 6:44 PM, Joshua Smith wrote:
> > 
> >> ActiveMQ Users-
> >>
> >> I have a project coming up where we'll be using ActiveMQ as our JMS  
> >> server
> >> between a Java application and a C/C++ application. I'd like to  
> >> exchange
> >> ObjectMessages. Is there anything special (e.g. endian) that I need  
> >> to be
> >> aware of? Does the C/C++ application have to have objects defined  
> >> that are
> >> the equivalent of my Java objects?
> >>
> >>
> >> Thanks,
> >> Joshua Smith
> > 
> > 
> > 
> 
-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message