You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Joshua Kramer <jo...@globalherald.net> on 2009/06/07 05:23:59 UTC
Non-standard transports
Hello,
Is there any support, in either Python or C++, for servers with
non-standard transports?
For example, suppose I have a message. I would like to call some method
on the message that would automatically determine its Operation,
dispatch the method call, and give me a message with the return value.
I am using the Apache QPid for all of my messages. Currently I am using
Google Protocol Buffers to do calls between Python clients and servers
via Apache QPid. My server daemon receives a message, deserializes it
via PB, dispatches to the correct method, and re-serializes the return
object to send back to the QPid server. The exception handling and
dispatch provided by Thrift is appealing...
Cheers,
-JK
Re: Non-standard transports
Posted by Terry Jones <te...@jon.es>.
Hi Joshua
>>>>> "Joshua" == Joshua Kramer <jo...@globalherald.net> writes:
Joshua> I am using the Apache QPid for all of my messages. Currently I am
Joshua> using Google Protocol Buffers to do calls between Python clients
Joshua> and servers via Apache QPid. My server daemon receives a message,
Joshua> deserializes it via PB, dispatches to the correct method, and
Joshua> re-serializes the return object to send back to the QPid server.
Joshua> The exception handling and dispatch provided by Thrift is
Joshua> appealing...
See as you are using Python, you should definitely take a close look at
txAMQP. It does what you want, you just need to use Twisted (support for
which is now built into Thrift). See https://launchpad.net/txamqp
Terry
Re: Non-standard transports
Posted by David Reiss <dr...@facebook.com>.
Use a TMemoryBuffer as the transport, then grab the contents of the buffer.
See checkWrite in test/FastbinaryTest.py
Joshua Kramer wrote:
> Is there a quick way to serialize an object to a string or blob?
>
> Thanks!
> -Josh
>
> On Sat, 6 Jun 2009, David Reiss wrote:
>
>> Date: Sat, 6 Jun 2009 20:37:43 -0700
>> From: David Reiss <dr...@facebook.com>
>> Reply-To: thrift-user@incubator.apache.org
>> To: "thrift-user@incubator.apache.org" <th...@incubator.apache.org>
>> Subject: Re: Non-standard transports
>>
>> I'm not sure I understand your exact use case, but it is fairly easy
>> in Thrift to swap out the standard transport implementations for your
>> own. It sounds like your use case is fairly similar to the THttpClient,
>> which is a TTransport that sends messages as http requests.
>>
>> --David
>>
>> Joshua Kramer wrote:
>>> Hello,
>>>
>>> Is there any support, in either Python or C++, for servers with
>>> non-standard transports?
>>>
>>> For example, suppose I have a message. I would like to call some method
>>> on the message that would automatically determine its Operation,
>>> dispatch the method call, and give me a message with the return value.
>>>
>>> I am using the Apache QPid for all of my messages. Currently I am using
>>> Google Protocol Buffers to do calls between Python clients and servers
>>> via Apache QPid. My server daemon receives a message, deserializes it
>>> via PB, dispatches to the correct method, and re-serializes the return
>>> object to send back to the QPid server. The exception handling and
>>> dispatch provided by Thrift is appealing...
>>>
>>> Cheers,
>>> -JK
>
Re: Non-standard transports
Posted by Bryan Duxbury <br...@rapleaf.com>.
TSerializer/TDeserializer work without a separate transport, if
you're in Java. There are similar classes in at least Ruby.
On Jun 6, 2009, at 10:39 PM, Joshua Kramer wrote:
>
> Is there a quick way to serialize an object to a string or blob?
>
> Thanks!
> -Josh
>
> On Sat, 6 Jun 2009, David Reiss wrote:
>
>> Date: Sat, 6 Jun 2009 20:37:43 -0700
>> From: David Reiss <dr...@facebook.com>
>> Reply-To: thrift-user@incubator.apache.org
>> To: "thrift-user@incubator.apache.org" <thrift-
>> user@incubator.apache.org>
>> Subject: Re: Non-standard transports
>> I'm not sure I understand your exact use case, but it is fairly easy
>> in Thrift to swap out the standard transport implementations for your
>> own. It sounds like your use case is fairly similar to the
>> THttpClient,
>> which is a TTransport that sends messages as http requests.
>>
>> --David
>>
>> Joshua Kramer wrote:
>>> Hello,
>>>
>>> Is there any support, in either Python or C++, for servers with
>>> non-standard transports?
>>>
>>> For example, suppose I have a message. I would like to call some
>>> method
>>> on the message that would automatically determine its Operation,
>>> dispatch the method call, and give me a message with the return
>>> value.
>>>
>>> I am using the Apache QPid for all of my messages. Currently I
>>> am using
>>> Google Protocol Buffers to do calls between Python clients and
>>> servers
>>> via Apache QPid. My server daemon receives a message,
>>> deserializes it
>>> via PB, dispatches to the correct method, and re-serializes the
>>> return
>>> object to send back to the QPid server. The exception handling and
>>> dispatch provided by Thrift is appealing...
>>>
>>> Cheers,
>>> -JK
>>
>
> --
>
> -----
> http://www.globalherald.net/jb01
> GlobalHerald.NET, the Smarter Social Network! (tm)
Re: Non-standard transports
Posted by Joshua Kramer <jo...@globalherald.net>.
Is there a quick way to serialize an object to a string or blob?
Thanks!
-Josh
On Sat, 6 Jun 2009, David Reiss wrote:
> Date: Sat, 6 Jun 2009 20:37:43 -0700
> From: David Reiss <dr...@facebook.com>
> Reply-To: thrift-user@incubator.apache.org
> To: "thrift-user@incubator.apache.org" <th...@incubator.apache.org>
> Subject: Re: Non-standard transports
>
> I'm not sure I understand your exact use case, but it is fairly easy
> in Thrift to swap out the standard transport implementations for your
> own. It sounds like your use case is fairly similar to the THttpClient,
> which is a TTransport that sends messages as http requests.
>
> --David
>
> Joshua Kramer wrote:
>> Hello,
>>
>> Is there any support, in either Python or C++, for servers with
>> non-standard transports?
>>
>> For example, suppose I have a message. I would like to call some method
>> on the message that would automatically determine its Operation,
>> dispatch the method call, and give me a message with the return value.
>>
>> I am using the Apache QPid for all of my messages. Currently I am using
>> Google Protocol Buffers to do calls between Python clients and servers
>> via Apache QPid. My server daemon receives a message, deserializes it
>> via PB, dispatches to the correct method, and re-serializes the return
>> object to send back to the QPid server. The exception handling and
>> dispatch provided by Thrift is appealing...
>>
>> Cheers,
>> -JK
>
--
-----
http://www.globalherald.net/jb01
GlobalHerald.NET, the Smarter Social Network! (tm)
Re: Non-standard transports
Posted by David Reiss <dr...@facebook.com>.
I'm not sure I understand your exact use case, but it is fairly easy
in Thrift to swap out the standard transport implementations for your
own. It sounds like your use case is fairly similar to the THttpClient,
which is a TTransport that sends messages as http requests.
--David
Joshua Kramer wrote:
> Hello,
>
> Is there any support, in either Python or C++, for servers with
> non-standard transports?
>
> For example, suppose I have a message. I would like to call some method
> on the message that would automatically determine its Operation,
> dispatch the method call, and give me a message with the return value.
>
> I am using the Apache QPid for all of my messages. Currently I am using
> Google Protocol Buffers to do calls between Python clients and servers
> via Apache QPid. My server daemon receives a message, deserializes it
> via PB, dispatches to the correct method, and re-serializes the return
> object to send back to the QPid server. The exception handling and
> dispatch provided by Thrift is appealing...
>
> Cheers,
> -JK