# Which client for an JEE application?

**URL:** <https://discuss.elastic.co/t/which-client-for-an-jee-application/12968>\
**Category:** Elasticsearch\
**Created:** [July 27, 2013, 3:08pm UTC](https://discuss.elastic.co/t/which-client-for-an-jee-application/12968 "2013-07-27T15:08:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [July 27, 2013, 3:08pm UTC](https://discuss.elastic.co/t/which-client-for-an-jee-application/12968/1 "2013-07-27T15:08:14Z")

</div>

Dear all,

I am integrating ES in one of our application. The application itself is  
a classical JEE application based on Glassfish. Among other things the  
application will be responsible for updating the documents in ES. So  
which client can I use? I assume that node client as well as the  
transport client manage their own thread pool? Or should I use only the  
Jest client? So, which of the available Java clients does not conflict  
the JEE requirement not to manage your own thread pool in your application?

It would be great if someone could change his experience on ES and JEE  
with us.

Best,

Oliver

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [July 27, 2013, 7:01pm UTC](https://discuss.elastic.co/t/which-client-for-an-jee-application/12968/2 "2013-07-27T19:01:07Z")

</div>

I use TransportClient as a singleton instantiated by web app context  
listener in my JEE environments, Glassfish, JBoss, or Jetty.

While NodeClient has no config for TCP/IP, TransportClient is most flexible  
for remote access via network interfaces. It is recommended not to run  
frontends like JEE servers on the same server, so an ES data node can run  
with best resource usage.

Maybe I don't understand the threadpool question. The threadpool in the ES  
client is builtin, you can't disable it, otherwise, you simply can't  
contact other nodes. There are a lot of config options to tailor the client  
threadpool.

Why are you asking for conflict with JEE requirements? I am not aware of  
any conflicts. ES TransportClient is easy to use.

Jörg

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Oliver\_B\_Fischer](https://avatars.discourse-cdn.com/v4/letter/o/f04885/32.png) [@Oliver\_B\_Fischer](https://discuss.elastic.co/u/Oliver_B_Fischer)\
**Post date:** [July 28, 2013, 3:56pm UTC](https://discuss.elastic.co/t/which-client-for-an-jee-application/12968/3 "2013-07-28T15:56:50Z")

</div>

Am 27.07.13 21:01, schrieb [joergprante@gmail.com](mailto:joergprante@gmail.com):

> Why are you asking for conflict with JEE requirements? I am not aware of  
> any conflicts. ES TransportClient is easy to use.

I am asking because of EJB restriction not to "create or manage threads"  
in your application [1]. So using a component that has its own thread  
management would violate this requirement. Mostly its work but I prefer  
to respect the EJB restrictions.

Best,

Oliver

[1]: [EJB Restrictions](http://www.oracle.com/technetwork/java/restrictions-142267.html))

> Jörg
> 
> --  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2013, 5:53pm UTC](https://discuss.elastic.co/t/which-client-for-an-jee-application/12968/4 "2013-07-28T17:53:39Z")

</div>

Yeah. You're not suppose to do that but it works well.  
What you should avoid is to reload your webapp without stopping the container (redeploy for example). You will get OOM as some threads won't be stopped (old issue in Guava as far as I remember).

I used Node Client first and then Transport client within Jboss and did not see any particular issue.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 28 juil. 2013 à 17:56, "Oliver B. Fischer" [mailsink@swe-blog.net](mailto:mailsink@swe-blog.net) a écrit :

Am 27.07.13 21:01, schrieb [joergprante@gmail.com](mailto:joergprante@gmail.com):

> Why are you asking for conflict with JEE requirements? I am not aware of  
> any conflicts. ES TransportClient is easy to use.

I am asking because of EJB restriction not to "create or manage threads" in your application [1]. So using a component that has its own thread management would violate this requirement. Mostly its work but I prefer to respect the EJB restrictions.

Best,

Oliver

[1]: [EJB Restrictions](http://www.oracle.com/technetwork/java/restrictions-142267.html))

> Jörg
> 
> --  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:24am UTC](https://discuss.elastic.co/t/which-client-for-an-jee-application/12968/5 "2017-07-06T02:24:07Z")

</div>


