Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Client configuration setting are not applied to Async calls #219

Closed
iliasbartolini opened this issue Jun 29, 2015 · 5 comments
Closed

Client configuration setting are not applied to Async calls #219

iliasbartolini opened this issue Jun 29, 2015 · 5 comments
Labels

Comments

@iliasbartolini
Copy link

In the sample below when the query is executed the client connection settings (eg. maxTotalConnetion, defaultMaxTotalConnectionPerRoute, ...etc.) are not applied to a Async calls.

val factory: JestClientFactory = new JestClientFactory()
factory.setHttpClientConfig(new Builder(uri)
  .maxConnectionIdleTime(10, TimeUnit.SECONDS)
  .maxTotalConnection(50)
  .defaultMaxTotalConnectionPerRoute(30)
  .connTimeout(3000)
  .readTimeout(2000)
  .multiThreaded(true)
  .build())
val jectClient = factory.getObject

jestClient.executeAsync(search, handler)
@kramer
Copy link
Member

kramer commented Jun 30, 2015

Well this is embarrassing, looks like I forgot to set all those config objects (and more!) on the async client... will fix it asap.

In the meantime I'm open for ideas on how to test this as it seems hard to get the config values from the final client object.

@kramer kramer added the bug label Jun 30, 2015
@iliasbartolini
Copy link
Author

Not sure how to help on the testing question but meanwhile I'm leaving here a note for a temporary workaround we adopted. Might be useful in case other people are reading this because stumbled on the same problem while it gets a proper fix.
We are just re-setting the HttpAsyncClient downcasting JestClient to JestHttpClient and using JestHttpClient.setAsyncClient(...)

val client = factory.getObject
client match {
  case jestHttpClient: JestHttpClient => {
    jestHttpClient.setAsyncClient(HttpAsyncClients.custom().setMaxConnPerRoute(...).setMaxConnTotal(...).build())
    jestHttpClient
  } 

@kramer kramer closed this as completed in 563b658 Jul 1, 2015
@cricanr
Copy link

cricanr commented Jul 29, 2015

Hi,

Do you have any information when this fix will be released?

Thanks,
Radu

@kramer
Copy link
Member

kramer commented Jul 29, 2015

@cricanr next stable version release is planned for 16.08.2015, in the meantime you can use the snapshot.

@cricanr
Copy link

cricanr commented Jul 30, 2015

@kramer , ok, thanks for the info. We'll try then the snapshot :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants