Skip to content

Commit

Permalink
finatra-thrift: Respect ThriftServer stack params in JavaRouter/Abstr…
Browse files Browse the repository at this point in the history
…actThriftRouter

Problem

`JavaThriftRouter` ignores key Thrift params (such as protocolFactory, maxThriftBufferSize, etc)
configured via  `configureThriftServer`. This problem is partially worked around via accepting
protocolFactory along with the controller in `JavaThriftRouter.add`. The other Thrift params are
less fortunate.

Solution

Respect Thrift params configured on ThriftMux stack server in `JavaThriftRouter` and remove the
old `add(controller, protocolFactory)` method from the `JavaThriftRouter` API as it's now obsolete.

Results

There is now a single way of configuring Thrift-specific params for Finatra's Thrift servers that works
as expected in both, Java and Scala settings.

JIRA Issues: CSL-10136, CSL-10446

Differential Revision: https://phabricator.twitter.biz/D593876
  • Loading branch information
vkostyukov authored and jenkins committed Dec 18, 2020
1 parent a13fce4 commit debefa8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ object ThriftMux
def stack: Stack[ServiceFactory[mux.Request, mux.Response]] =
muxer.stack

protected val serverParam: RichServerParam = RichServerParam(
protected[twitter] val serverParam: RichServerParam = RichServerParam(
protocolFactory = params[Thrift.param.ProtocolFactory].protocolFactory,
serviceName = params[Label].label,
maxThriftBufferSize = params[Thrift.param.MaxReusableBufferSize].maxReusableBufferSize,
Expand Down

0 comments on commit debefa8

Please sign in to comment.