So just create a Singleton for the full JVM and share it across all threads. Don’t create and close client for each request. close() should be called only when you totally stop your application.
BTW you can look at this: https://github.com/dadoonet/spring-elasticsearch <https://github.com/dadoonet/spring-elasticsearch> My 2 cents -- David Pilato | Technical Advocate | Elasticsearch.com @dadoonet <https://twitter.com/dadoonet> | @elasticsearchfr <https://twitter.com/elasticsearchfr> | @scrutmydocs <https://twitter.com/scrutmydocs> > Le 12 janv. 2015 à 15:15, Pablo Blasco <[email protected]> a écrit : > > We have a socket config. The problem its the connections keep alive before > we do a client.close() statement. > > We want to usage the same connection object with diferent clients if its > posible... > > > Thanks > > > El lunes, 12 de enero de 2015, 15:11:22 (UTC+1), David Pilato escribió: > Why do you need a pool? > > -- > David Pilato | Technical Advocate | Elasticsearch.com > <http://elasticsearch.com/> > @dadoonet <https://twitter.com/dadoonet> | @elasticsearchfr > <https://twitter.com/elasticsearchfr> | @scrutmydocs > <https://twitter.com/scrutmydocs> > > > >> Le 12 janv. 2015 à 14:11, Pablo Blasco <[email protected] <javascript:>> a >> écrit : >> >> Its posible create an elasticsearch pool like an hibernate pool?? >> >> >> Thanks >> >> -- >> You received this message because you are subscribed to the Google Groups >> "elasticsearch" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elasticsearch/03be8ad7-40cf-4442-ad39-d76509a8ca10%40googlegroups.com >> >> <https://groups.google.com/d/msgid/elasticsearch/03be8ad7-40cf-4442-ad39-d76509a8ca10%40googlegroups.com?utm_medium=email&utm_source=footer>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "elasticsearch" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/6a8d402d-d2c7-4fed-8704-9b5e1be1a0fd%40googlegroups.com > > <https://groups.google.com/d/msgid/elasticsearch/6a8d402d-d2c7-4fed-8704-9b5e1be1a0fd%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/A6A77B32-D3AF-47E3-8986-11A56A8286E0%40pilato.fr. For more options, visit https://groups.google.com/d/optout.
