Reputation: 153
I have an existing java thrift server serving api's on TCompactProtocol used by external applications. I need to add TJsonProtocol support for the same service to serve JS clients.
I understand I can use thrift multiplexing with a wrapper TMultiplexedProtocol over underlying protocols. But this would firstly need a change in the client code to use the lookup and also I havent seen much support for TMultiplexedProtocol in thrift JS library.
In the examples online and documentation I have only seen thirft multiplexing with multiple services using the same protocol and transport. Is it not possible to support multiple protocols?
Upvotes: 1
Views: 368
Reputation: 13411
In the examples online and documentation I have only seen thirft multiplexing with multiple services using the same protocol and transport. Is it not possible to support multiple protocols?
Exactly, or in your case: unfortunately. The TMultiplexProtocol
is designed to share one physical endpoint between multiple services. This implies, that all services are required to use the same protocol/transport stack.
If you have different requirements like using compact and JSON protodols in parallel, you need two distinct physical endpoints (sockets, pipes, URLs, etc.)
Upvotes: 1