Questions tagged [twitter-finagle]

58 questions
1
vote
0 answers

unit testing - stubbing or mocking finagle client

Here is the few lines of code I would like to unit test for different http response codes. One of them is code 201 . Please advise val cb = ClientBuilder() val myClient = cb.build() val req = RequestBuilder() .url(loginUrl) …
RajKon
  • 420
  • 1
  • 8
  • 20
1
vote
1 answer

How to limit the connections number Finagle creates?

I use Finalge https://twitter.github.io/finagle/ to test the timeout case like this: Server side: in the RPC definition, Just sleep 10 secs and return. Client side: call RPC function using within like within(50.milliseconds) onSuccess { ... }…
hliu
  • 1,015
  • 8
  • 16
1
vote
1 answer

Finatra - how to add url encoder

I have a finatra server, in the response string there are currency symbols. which looks fine in the server but in the browser I get £5.25 instead of £5.25 any advice on how to fix this issue? recommended url encoder? thanks, Dana
Dana Klein
  • 159
  • 1
  • 12
1
vote
1 answer

concurrent requests limit of Twitter-Finagle

I create a thrift server using Finagle like this val server = Thrift.serveIface(bindAddr(), new MyService[Future] { def myRPCFuction() {} }) But, I found that the maximum number of concurrent requests is five( why 5? when more than 5, the server…
hl1020
  • 529
  • 5
  • 11
1
vote
1 answer

is client thread-safe in Twitter Finagle

Is the the client in Twitter Finagle thread-safe ? I don't want to call newClient in each RPC function (I think it will make a new connection to destination end, is it?) So it seems that re-using the same client object is a good choice. But,…
hl1020
  • 529
  • 5
  • 11
1
vote
2 answers

Twitter Finagle client: How to make external REST api call?

I'm trying to make an external (to finagle server) REST GET request in my finagle code, the URI for is: http://service.site-dev.com/subservices/list I'm using the client code found in the example at :…
pl0u
  • 365
  • 7
  • 16
1
vote
2 answers

Server .codec(Http()) not working as specified in example code

I am attempting to try out Finagle for the first time. I am new to Scala, so this question may seem easy to many of you. I pulled 6.10.1-SNAPSHOT from GitHub, and attempted to implement the Robust Server example shown in the docs. The imports were…
JohnC
  • 61
  • 4
1
vote
2 answers

Map or match a Scalaz.EitherT

I have this for-comprehension: val seq = for { accessToken <- EitherT(getAccessToken(code)) data <- EitherT(getDefaultData(accessToken)) user <- EitherT(mapUser(data.getResponseBody)) } yield { if…
flavian
  • 28,161
  • 11
  • 65
  • 105
0
votes
0 answers

Finagle connect to a service and not the host

I have a server that hosts many services. In a scala application, I need to query one of its services : service1/api/endpoint1 The problem I'm facing, is that Http.client.newService expects a host with a port, so in my case val client:…
Crovish
  • 183
  • 10
0
votes
1 answer

Could we use sleuth without spring cloud?

I am working in a project which uses scala and twitter server finagle. Our project's requirement has logging and tracing. While searching, I came across sleuth and zipkin. I am able to integrate zipkin as I found library for finagle but couldn't…
0
votes
1 answer

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": "End" } Here's my code: handle(GetStatus) { args: GetStatus.Args => …
asquare14
  • 33
  • 1
  • 6
0
votes
1 answer

configuration of twitter finagle redis client with tls enabled

How do I configure the finagle Redis client with tls-enabled? @Provides def providesRedisClient(@Flag("redis-addr") host: String): redis.Client = { redis.Client(host) } as the function we used only took redis-endpiont.
loren
  • 1
0
votes
1 answer

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 documentation at https://twitter.github.io/twitter-server…
eran
  • 21
  • 3
0
votes
1 answer

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.{Http, Stack} val client = Http.client val…
user51
  • 8,843
  • 21
  • 79
  • 158
0
votes
1 answer

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.Http import…
user51
  • 8,843
  • 21
  • 79
  • 158