activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tabish...@gmail.com>
Subject Re: Configuring MarshallerFactory in .NET
Date Tue, 03 Feb 2009 02:51:01 GMT
The CSharpGeneratorTask and associated classes were intended only as a
way to create .Net representations of the OpenWire commands used to
communicate between the Java and .Net client.  To send you own .Net
objects to an Java client or Java to .Net you will need to perform some
sort of Transformation to XML or JSON for example and send the data in a
TextMessage or BytesMessage.  

The OpenWire protocol was not intended to know how to marshal your
own .Net objects to Java, its only meant to be the communication
protocol between ActiveMQ clients, which can be Java, .Net, C++ etc.
Sending object messages to non Java clients is just not that simple.
The Java client allows for a Transformation plugin to be used so that
the java client could turn an ObjectMessage into an XML encoded
TextMessage for instance making that part of it transparent.  

See this page for info on Message Transformation in the Java client.
http://activemq.apache.org/message-transformation.html

On the CSharp side you'd need to add a layer above the client code to
make this sort of transformation on you .Net Objects as the NMS client
doesn't yet have Message Transformation Plugin features like the Java
side has.  

So in short when sending messages between clients other than Java
clients you shouldn't really be thinking ObjectMessage, you will have to
use the more generic TextMessage or BytesMessage as you means of
transport and transform back to you own objects on either end.

Regards
Tim.


On Mon, 2009-02-02 at 18:02 -0800, dougly wrote:
> I basically have a need to send an object thru OpenWire to activeMQ.
> The C# code files were generated by CSharpGeneratorTask.
> 
> I hope you could provide me any link to documentation regarding this I
> appreciate.
> 
> Doug
> 
> 
> 
> semog wrote:
> > 
> > Hi Doug,
> > 
> > I'm not quite sure what your ultimate goal is, but your code looks
> > like it is trying to configure the wire protocol to use OpenWire.  If
> > that is the case, you don't need all that advanced code.  You can use
> > the NMSConnectionFactory object and pass in a URI string that
> > configures your wireformat, and several other connection and session
> > settings.  If you would like some links to documentation on URI
> > parameter configuration, let me know.  Otherwise let me know if I have
> > misunderstood your intentions.
> > 
> > Best,
> > Jim
> > 
> > On 1/31/09, dougly <dmly.usa@gmail.com> wrote:
> >>
> >> Hi folks,
> >> I used the CSharpGeneratorTask to create the corresponding C#
> >> serializable
> >> classes along with a MarshallerFactory several classes to do the
> >> serialization.
> >> Now in my client code in .NET what do I need to do to configure the
> >> Marshallerfactory.
> >>
> >> IConnectionFactory fac = new ConnectionFactory("tcp://localhost:61616");
> >>
> >>             using (IConnection conn = fac.CreateConnection())
> >>             {
> >>
> >>                 MarshallerFactory mfac = new MarshallerFactory();
> >>                 ITransport itrans = ((Connection) conn).ITransport;
> >>                 if (itrans.GetType() == typeof(TcpTransport))
> >>                 {
> >>                     Console.WriteLine("Marshaller added ...");
> >>                     TcpTransport trans = (TcpTransport)
> >> ((Connection)conn).ITransport;
> >>                     mfac.configure((OpenWireFormat) trans.Wireformat);
> >>                 }
> >>
> >>                 conn.Start();
> >>                 ISession session = conn.CreateSession();
> >>
> >> But I guess this is not going to work.
> >>
> >> Thanks guys
> >> Doug
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Configuring-MarshallerFactory-in-.NET-tp21771528p21771528.html
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> > 
> > 
> 
-- 
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Mime
View raw message