Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

elasticsearch client thread safety

I am writting a query plugin, that will build the query for given keywords and pass it to elastic search client to process.

My handler class extends BaseRestHandler, and I've the Client object being injected in my handler's constructor.

@Inject
protected QueryHandler(Settings settings, Client client, RestController controller) {
    super(settings, client);
    controller.registerHandler(GET, "/_query/{queryBuilder}", this);
}

I was wondering if it's thread safe to use the same client object in handleRequest() method?

like image 561
apatel Avatar asked Apr 02 '13 20:04

apatel


1 Answers

It looks like any implementation of the client is thread safe. Check out @kimchy's answer here: http://elasticsearch-users.115913.n3.nabble.com/Is-NodeClient-thread-safe-td2816264.html

like image 98
Justin Avatar answered Oct 13 '22 15:10

Justin