You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Jonathan Marcus <ja...@jobstick.com> on 2009/04/03 17:55:45 UTC
Server-to-server communication with serialized objects
Hi,
I have a bunch of C# servers that need to talk to each other, and I'm
using Thrift to handle the communication. My programs use their own
objects internally, and I'd prefer to leave their structure out of my
.thrift file.
What would be the best way to pass these objects back and forth? They're
all serializable, so I'm thinking that I should just convert them into a
byte-array and put it into a 'binary' type, but I don't know if that
type is fully supported in C#.
Any thoughts/ideas?
Thanks,
Jonathan
Re: Server-to-server communication with serialized objects
Posted by Michael Greene <mi...@gmail.com>.
The binary type is supported in C# as well as any other type. We used
to use roughly this technique during a proof of concept phase before
converting more of our structures to Thrift, it should work fine. Let
us know if you have any problems, but it sounds like a reasonable idea
Jonathan (of course, these are completely unusable to non-.NET
endpoints, but they can process the rest of the message just fine and
ignore the .NET bytes).
Michael
On Fri, Apr 3, 2009 at 11:31 AM, Bryan Duxbury <br...@rapleaf.com> wrote:
> Assuming that the binary type is well supported in C#, your idea certainly
> sounds like the right idea. Maybe one of our C# people can chime in about
> binary support?
>
> -Bryan
>
> On Apr 3, 2009, at 8:55 AM, Jonathan Marcus wrote:
>
>> Hi,
>>
>> I have a bunch of C# servers that need to talk to each other, and I'm
>> using Thrift to handle the communication. My programs use their own objects
>> internally, and I'd prefer to leave their structure out of my .thrift file.
>>
>> What would be the best way to pass these objects back and forth? They're
>> all serializable, so I'm thinking that I should just convert them into a
>> byte-array and put it into a 'binary' type, but I don't know if that type is
>> fully supported in C#.
>>
>> Any thoughts/ideas?
>>
>> Thanks,
>> Jonathan
>
>
Re: Server-to-server communication with serialized objects
Posted by Bryan Duxbury <br...@rapleaf.com>.
Assuming that the binary type is well supported in C#, your idea
certainly sounds like the right idea. Maybe one of our C# people can
chime in about binary support?
-Bryan
On Apr 3, 2009, at 8:55 AM, Jonathan Marcus wrote:
> Hi,
>
> I have a bunch of C# servers that need to talk to each other, and
> I'm using Thrift to handle the communication. My programs use their
> own objects internally, and I'd prefer to leave their structure out
> of my .thrift file.
>
> What would be the best way to pass these objects back and forth?
> They're all serializable, so I'm thinking that I should just
> convert them into a byte-array and put it into a 'binary' type, but
> I don't know if that type is fully supported in C#.
>
> Any thoughts/ideas?
>
> Thanks,
> Jonathan