How to make PreBuiltXPackTransportClient reusable?

Create a PreBuiltXPackTransportClient object need username and password,so every logined person will has their own PreBuiltXPackTransportClient object,
In order to make PreBuiltXPackTransportClient object reusable,I store them in a map,but if millions of people login in my system for searching,the map will take up more memory,and I don't known which PreBuiltXPackTransportClient object I should remove and clean .
What should I do for this problem?

You should move to the REST client. It has a Request Option that is probably useful for that.


Thanks dadoonet, I will try it

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.