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

two JestClient with one compression enabled and another disable #665

Open
jasonwee opened this issue Nov 14, 2019 · 0 comments
Open

two JestClient with one compression enabled and another disable #665

jasonwee opened this issue Nov 14, 2019 · 0 comments

Comments

@jasonwee
Copy link

Hi, is it possible to create two jest clients objects and call on different queries with different clients?

Example

 JestClientFactory factory = new JestClientFactory();
 factory.setHttpClientConfig(new HttpClientConfig
                        .Builder("http://localhost:9200")
                        .multiThreaded(true)
			//Per default this implementation will create no more than 2 concurrent connections per given route
			.defaultMaxTotalConnectionPerRoute(<YOUR_DESIRED_LEVEL_OF_CONCURRENCY_PER_ROUTE>)
			// and no more 20 connections in total
			.maxTotalConnection(<YOUR_DESIRED_LEVEL_OF_CONCURRENCY_TOTAL>)
			.requestCompressionEnabled(true)
                        .build());
 JestClient client = factory.getObject();
 
 JestClientFactory factoryNoCompression = new JestClientFactory();
 factoryNoCompression.setHttpClientConfig(new HttpClientConfig
                        .Builder("http://localhost:9200")
                        .multiThreaded(true)
			//Per default this implementation will create no more than 2 concurrent connections per given route
			.defaultMaxTotalConnectionPerRoute(<YOUR_DESIRED_LEVEL_OF_CONCURRENCY_PER_ROUTE>)
			// and no more 20 connections in total
			.maxTotalConnection(<YOUR_DESIRED_LEVEL_OF_CONCURRENCY_TOTAL>)
			.requestCompressionEnabled(false)
                        .build());
 JestClient clientNoCompression = factoryNoCompression.getObject();
 
 
 client.execute(query1)
 clientNoCompression.execute(query2)

if yes, what will the client compression send to the server for both clients?

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

No branches or pull requests

1 participant