[ 
https://issues.apache.org/jira/browse/THRIFT-66?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15111335#comment-15111335
 ] 

James E. King, III commented on THRIFT-66:
------------------------------------------

I looked for "push notification", "two-way", and "bidirectional" in Jira and I 
didn't find anything interesting.  I agree with you, the ability for the client 
to set up a server on one of the multiplexed protocols would be quite useful.  
This is something we'd like in a project I am working on as well.  I'm 
surprised there isn't already a ticket for this.  It's probably in there, 
somewhere...

> Java: Allow multiplexing multiple services over a single TCP connection
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-66
>                 URL: https://issues.apache.org/jira/browse/THRIFT-66
>             Project: Thrift
>          Issue Type: Sub-task
>          Components: C# - Library, C++ - Library, Cocoa - Library, Erlang - 
> Library, Java - Library, Perl - Library, Python - Library, Ruby - Library
>            Reporter: Johan Stuyts
>            Assignee: Roger Meier
>            Priority: Trivial
>             Fix For: 0.9.2
>
>         Attachments: CalculatorImpl.java, MultiplexTestClientMain.java, 
> MultiplexTestServerMain.java, ReleaseWaitingReplyThreadsOnDisconnect.patch, 
> SharedImpl.java, TMultiplexServer.java, TMultiplexServer.py, 
> TSimpleMultiplexServer.java, Thrift Endpoints and Channels.vsd, 
> ThriftCSharpEndpointsChannels.zip, ThriftMultiplexInvocationHandler.java
>
>
> The current {{TServer}} implementations expose a single service on a port. If 
> an application has many services many ports have to be opened. This is 
> cumbersome because:
> - you have to document which service is available on which port, and 
> remembering the port numbers is difficult
> - to prevent the overhead of connection setup on each call, a client has to 
> maintain to many connections: at least one to each port
> - it requires opening many ports on a firewall if one is between the client 
> and the server.
> By multiplexing multiple services on a single port the problems above are 
> resolved:
> - instead of a port number a symbolic name can be assigned to a service
> - a client can maintain a small pool of connections to a single port
> - only one port has to be opened on the firewall
> The attached Java implementation simply wraps a normal {{CALL}} message with 
> a (new) {{SERVICE_SELECTION}} message. It is not necessary to modify or wrap 
> the response. No changes are needed to the generated classes. Only a new type 
> of server is introduced, and an invocation handler for a dynamic proxy around 
> the {{Client}} classes of services is provided for the client side. The 
> implementation does not handle communication errors (invalid data, timeouts, 
> etc.) yet.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to