This sounds reasonable to me and is probably how I would design such a system. Thrift clients/servers are fundamentally unidirectional RPC, not a bidirectional messaging system, so having a server on each end makes the most sense. It sounds like what you really want here is asynchronous messaging library, which isn't Thrift's primary intended purpose but can certainly be accomplished.
One other technical possibility is to borrow from the COMET approach: http://en.wikipedia.org/wiki/Comet_(programming) Basically, you could use long timeouts and leave a client request open. This, however, is pretty hackneyed and I would only suggest this approach if there were some reason why you did not want to have server ports open on the client. But it sounds like you're fine with that. Hope that helps... Let us know how it goes. Cheers, Mark -----Original Message----- From: Rush Manbert [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2008 2:28 PM To: [email protected] Subject: Notification Strategy We have a Thrift server application that manages data on behalf of numerous clients. We would like to add the capability for clients to be notified when the managed data is changed. Clients would tell the server what data they care about, and would be notified asynchronously if the data changes. Clients talk to the server through an object interface that we have layered on top of the Thrift client side interface. We were thinking that we could add the notifications capability by adding a Thrift server to the client side object. This server would listen for notification messages on a runtime-selected port address. He would register the port address with the managed data server when the client side object is instantiated. We like this approach because it means all of our client/server interactions use a Thrift interface. It lets us easily have clients be remote to the server. My question is whether this seems like a good approach to the list readers and the Thrift developers. Is there some mechanism already in place within the Thrift library for this? Is there some other better approach? Thanks, Rush
