Questions tagged [finagle]
Finagle is an open source network stack from Twitter that you can use to build asynchronous Remote Procedure Call (RPC) clients and servers in Java, Scala, or any other JVM-hosted language.
171
questions
3
votes
0
answers
33
views
Scala Design Question - Unify 3 similar endpoints to retrieve from database
I'm designing a Scala service which has 3 endpoints which are very similar -
a. getUserByUserID(userIds: List[UserID]): List[User]
b. getUserByEmployeeID(employeeIDs: List[EmployeeID]): List[User]
c. ...
0
votes
0
answers
45
views
Finagle service discovery issue
Here I wanted to register to 2 endpoints and send requests to them. You can see this in the code below. I name one env1 and the other env2.
val client = Http.client
.configured(Transport.Options(...
0
votes
1
answer
136
views
SSlconfiguration exception on finagle upgrade
I recently upgraded to finagle-core 22.4.0 from 21.4.0 and see this while loading integration tests in the application. I use wiremock-standalone version 2.27.2. Netty version is 4.1.73.Final. How can ...
0
votes
0
answers
245
views
Logs are getting filled up with io.netty.handler.ssl.SslClosedEngineException: SSLEngine closed already
I have a service in which I was using the following
finagle with a version = "21.4.0"
finatra with a version = "20.9.0"
Due to some security patches we upgraded it to ...
1
vote
0
answers
126
views
Whitelist dependency for dependencyConvergence rule in Maven Enforcer plugin
I have the following Maven dependency in the tree:
...
[INFO] | | | \- io.netty:netty-tcnative-boringssl-static:jar:2.0.50.Final:compile
[INFO] | | | +- io.netty:netty-tcnative-classes:jar:2....
2
votes
0
answers
57
views
Finagle and load balancing
I have seen in many places that Finagle has service discovery and load balancing capabilities, but I cannot find any reference to actual detailed implementation.
How does Finagle client get the ...
0
votes
0
answers
17
views
Finagle: the path /$/ and the Namers
Apparently there is a way to define "namers", and as far as I have been able to know, there are at least:
/$/inet/...
/$/com.twitter.serverset/...
Where can I get documentation of these &...
0
votes
0
answers
13
views
Finagle system paths
I am finding it very hard to find documentation on how the DTAB resolvers actually work.
From the Finagle documentation:
A path starting with $ are called “system paths” and are treated specially by ...
0
votes
1
answer
295
views
Print the JSON response from GET request in Finagle
I am trying to do a GET request and print the JSON response that I get back. The JSON response should look like this.
{
"request_status": "Success",
"workflow_step&...
0
votes
1
answer
299
views
error: object Service is not a member of package com.twitter.finagle - Defining Bazel dependencies in Build file, Scala finagle
Im trying to add the finagle-http library to my new bazel project as an external maven dependency. But getting the following error. I assume im doing something wrong in creating the build without ...
0
votes
1
answer
142
views
Simple hello world api using finagle - Error: object twitter is not a member of package com import com.twitter.finagle.Http
Im really new to this microservice world and was trying to learn from scratch. But for some reason not able to call a simple dependency.
Getting the error
object twitter is not a member of package ...
3
votes
1
answer
402
views
ChannelClosedException - Upstream Address: Not Available
Our scala/thrift service is using twitter finagle 2.12-18.10.0 with java8. The Service is working fine for single request or handful of requests but when we try to hit the service with lot many ...
0
votes
1
answer
69
views
Return Twitter's Future within a certain duration
According to Twitter Util's Future documentation, Future.within() or .by() "Returns a new Future that fails if it is not satisfied before the given time".
I was trying to use this, in Java, ...
2
votes
1
answer
410
views
Twitter Future blocking
Someone can explain me why the behavior of Twitter future is not Async?
Having this code
private val future: Future[String] = Future {
Thread.sleep(2000)
println(s"Running this effect ...
0
votes
1
answer
40
views
Finagle KetamaShardingServiceBuilder is unknown
We're using finagle as a rest api and as we need to have some exotic loadbalancing we used Finagle's KetamaShardingServiceBuilder available in 19.3
I tried updating finagle version to 20.10 but the ...
1
vote
1
answer
223
views
Scala: missing implicit generic parameter shapeless.LabelledGeneric.Aux[T,L], how to provide it?
I'm writing code for working with DB with finagle-postgres, I have mappers and sure I want to move common parts of code, as much as I can, to generic Mapper.
So, for example, I have Mapper
case class ...
0
votes
0
answers
61
views
Starting two Scala Finagle ListeningServers at once
I need to start two Finagle ListeningServers at once because I have to implement two different traits that extend ListeningServer.
/* A simplified example to give you an idea of what I'm trying to ...
1
vote
1
answer
448
views
How to make a finagle client automatic try to reconnect if the server goes down?
I'm testing finagle and got over the current situation:
Server:
import com.twitter.finagle.{Http, Service}
import com.twitter.finagle.http
import com.twitter.util.{Await, Future}
class Server(name: ...
0
votes
1
answer
304
views
how to set response with camelCase in finatra
I need to return a json response in camelCase with finatra but it is in snake_case by default. From what I found so far, I need to use ObjectMapper, but I can't understand where do I pass it once I ...
2
votes
1
answer
2k
views
What is the maximum number of outgoing HTTP connections a JVM app can make?
I have a Scala application that uses Finagle HTTP Client to make as much as 2k requests per second each to 10 external HTTP APIs behind proxy.
I have configured the connection pool size per external ...
0
votes
1
answer
128
views
What's the best way to pass a common request identifier across a chain of Filter/Services for logging in Finagle/Scala?
We use a lot of Finagle Filters and Services in our code. However, we don't support Zipkin in our infrastructure. At times there's a need to trace an incoming request across the chain of Filters/...
1
vote
0
answers
563
views
Deserializing Finagle Response
I'm writing Unit Test for a Finagle Controller and I'm having a hard time deserializing the Response from a twitter Future in order to validate. When I print the Future, I can see all the content, but ...
2
votes
0
answers
145
views
How does one get all query params from within a endpoint?
I'm writing a toy finch project and trying to allow requests to specify arbitrary query parameters to set some value. I am able to retrieve the value for a known parameter name (i.e. param[String]("...
5
votes
1
answer
291
views
Is it possible to have a generic logging filter in finagle that can be "inserted anywhere" in a chain of andThens?
In our code we create many "finagle pipelines" like so:
val f1 = new Filter[A,B,C,D](...)
val f2 = new SimpleFilter[C,D](...)
val f3 = new Filter[C,D,E,F](...)
val s = new Service[E,F](...)
val ...
1
vote
1
answer
322
views
Finch jsonBody custom parameter conversion
We are using jsonbody to convert json payload in the body to a scala case class:
val domainObject: Endpoint[String] = post("domain" :: jsonBody[DomainEvent] :: some_more ::
Now I want to limit the ...
0
votes
1
answer
245
views
TwitterServer (Finch/Finagle) seems to block api call till it finishes its calculation
I'm setting up a new rest server using TwitterServer, and it seems to block a new api call, till a previous one be finished.
Here is a simple modification of the basic code taken from the ...
0
votes
2
answers
469
views
Is it possible to have generic decorators in TypeScript that could be chained per their input/output types?
For some of our integrations we have rather "templatized" implementations in our code base which can be conveniently put into the "pipe and filter" pattern IMHO.
The "components" can be made to look ...
1
vote
1
answer
298
views
Finagle filter sequence of futures of option
I am using twitter finagle framework and given a sequence of future of optionals I would like to filter them based on the state of the option.
seqFuture : Seq[Future[Option[Foo]]]
val filteredFuture ...
0
votes
0
answers
106
views
Sharing connection pools between client instances in finagle
Given two or more finagle clients that have different destination names, if those names happen to resolve to the same inet address how to I get finagle to only maintain a single pool of connections to ...
0
votes
1
answer
71
views
Which of the listed .jar contains class 'com.twitter.finagle.stats.ExceptionStatsHandler'?
I have to use Finagle 6.35.0 for Scala 2.11 as a dependency.
I made my project dependent on
finagle-core_2.11-6.35.0.jar
finagle-stats_2.11-6.35.0.jar.
Error what I got:
java.lang....
0
votes
1
answer
167
views
cannot find symbol symbol: variable param location: class com.twitter.finagle.transport.Transport.Liveness
I'm using finagle scala library in my java code base.
Below is the sample code from finagle written in scala code.
import com.twitter.finagle.transport.Transport
import com.twitter.finagle.{...
0
votes
0
answers
168
views
Converting Guava futures to Twitter ones
I have a Finatra application that accesses Cassandra using Datastax driver which produces Guava Futures. The conversion is done by following code
import com.google.common.util.concurrent.{...
2
votes
1
answer
319
views
java.lang.IllegalArgumentException: Failure parsing Toggle config resources when updating Scala version from 2.11 to 2.12
I have maven project with Scala and java. We are using twitter finagle library version 18.9.0.
The current version of scala is 2.11.11 and I want to update the version to 2.12.6.
When I compile the ...
0
votes
1
answer
613
views
Finatra TooLongMessageException HTTP content length exceeded 5242880 bytes, despite flag setting more bytes
I'm seeing a
TooLongMessageException HTTP content length exceeded 5242880 bytes. exception thrown from my finatra server. Looking at the flags available via -help=true, it looks like the flag to set ...
4
votes
1
answer
846
views
com.twitter.util.Await doesn't raise a com.twitter.util.TimeoutException
I expect that this code will raise a TimeoutException, but it doesn't. What do I do wrong?
import com.twitter.conversions.time._
import com.twitter.util.{Await, Future}
object Tmp {
def main(args:...
0
votes
0
answers
674
views
Get Header from Post Request - Finch (Finagle)
So here is my code:
post((name :: stringBody) :+: headerOption[String]("AMI-WS-Header")) { (body: String, amiHeader: String) =>
val response: HttpResponse[String] = Http(url + name).headers(
...
0
votes
1
answer
320
views
no suitable method found for configured finagle in Java code
I've Java polyglot application which mainly has Java code and uses few Scala libraries as well.
The Scala below code compiles fine.
import com.twitter.finagle.Http.Client
import com.twitter.finagle....
0
votes
1
answer
139
views
Scala 2.12 interop with java 1.8 doesn't compile for twitter finagle code
I've Java polyglot application which mainly has Java code and uses few Scala libraries as well.
The Scala below code compiles fine.
import com.twitter.finagle.{Http, Service}
import com.twitter....
1
vote
0
answers
812
views
java.lang.NoClassDefFoundError: Could not initialize class com.twitter.finagle.Init$
I've project with dependency to finagle 7.1.0 and related libraries with Scala version as 2.11.11
When I upgraded the scala version to 2.12.6 and finagle version as 17.12.0 I'm getting below error.
...
0
votes
1
answer
122
views
Finagle Thrift NoSuchMethodError
I´m using Finagle thrift but when I build the server and service
val service = new EchoService$FinagleService(new EchoServiceImpl, new TBinaryProtocol.Factory())
val server = Thrift.server....
0
votes
1
answer
280
views
Finatra IntegrationTest failed with "object TwitterModule is not a member of package com.twitter.inject"
I got a problem when implementing IntegrationTest with Finatra on Scala. I'm just following their official docs for early implementation, but I got error
[error] D:\Workspace\OpenSource\kanca-api\src\...
0
votes
1
answer
411
views
Finch: how can i define Endpoint with param in the middle
i am trying to define an Endpoint with param in the middle.
something similar to:
get("foo" :: param("id") :: "goo")
so, i can call it with the following rest call:
http://mydomain/foo?id=99/goo
...
0
votes
1
answer
160
views
Finagle server dont ready after start
I have a Finagle server which apperently there´s no way to know when is rerally up.
Having this code
esbMockServer = Some(defaultServer
.serve(s"localhost:$esbPort", esbService))
...
1
vote
1
answer
467
views
How to change number of worker threads in finch/finagle?
I have a finch endpoint that works fine when sequential calls are made.in case of concurrent requests, service latency is increasing in the proportion of the number of concurrent requests.I have two ...
2
votes
1
answer
3k
views
Using Finagle Http client for https requests
I am trying to get some data from a REST web service. So far I can get the data correctly if I don't use HTTPS with this code working as expected -
val client = Http.client.newService(s"$host:80")
...
2
votes
0
answers
281
views
How do you combine multiple com.twitter.util.Awaitable's with Future.select semantics?
In a service, I have a main method that starts a com.twitter.finagle.ListeningServer and also creates a custom "channel" returning a com.twitter.util.Future that never completes (unless there is an ...
1
vote
0
answers
246
views
Finnagle Error running client/server in same JVM
I´m having a very bizzare behaviour with Twitter finagle client/server.
Having a Server
def start(): Unit = {
val port=8500
println(s"Running Finagle Mock Server in port $port.......")
...
5
votes
2
answers
231
views
How to handle put requests in Finatra?
I have a service which has a put endpoint. I want to be able to access the url param as well as the body.
How do I achieve this.
This is my endpoint:
put("/:customerNum") { foo: Foo =>
val ...
1
vote
1
answer
151
views
How to get JVM metrics with Finagle?
For the same application code, I get them to appear on machine A but not on B.
On machine B I still get many of the metrics mentioned in the Finagle docs, but not the JVM ones.
Is there any JVM ...
1
vote
1
answer
627
views
Thread pooling configurability in Finagle
Let's assume I've got two Finagle services, as per below
val service1: Service[http.Request, http.Response] = ???
val service2: Service[http.Request, http.Response] = ???
and I run them both against ...