You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by V R <ve...@gmail.com> on 2021/12/01 16:38:00 UTC

Question about Scala for Thrift (Scrooge)

Hello everyone,
My post is related to Scala with Thrift so I try to ask my question here if
someone could help me.
I am working with Thrift and I can use it to create microservices with its
polyglot feature (server in python and client in cpp, etc.).
As Thrift does not support Scala, I use Scrooge
http://twitter.github.io/scrooge/.
Does someone have some experience with Scrooge ?
Here are what I tried so far:
In Terminal of IDEA: >sbt scroogeGen then >sbt compile to create Scala
codes from hello.thrift.
I got those codes (Client and server) named HelloSvc$FinagleClient.scala
and HelloSvc$FinagleService.scala:
https://scastie.scala-lang.org/ojqjfUYTTXeleCDZ9zOs1w
https://scastie.scala-lang.org/KG8TgmheRVqT1KOIFq16Ug

I have those sbt file:
https://scastie.scala-lang.org/UceQsvtJQV21faHnzi8qVQ
https://scastie.scala-lang.org/sB9LGMx5SByfjK3F13q0IQ

My service (hello.thrift) is a very simple one:
service HelloService {
string hello_func()
}

I found that the generated codes from scrooge are “weird” and “complicated”
compared to the ones generated with Thrift.
I understand that this is not maybe a place to discuss this topic but I’m
struggling with that.

Thank you