# Import java transportClient only

**URL:** <https://discuss.elastic.co/t/import-java-transportclient-only/20758>\
**Category:** Elasticsearch\
**Created:** [November 14, 2014, 8:00pm UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758 "2014-11-14T20:00:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filip\_2](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@Filip\_2](https://discuss.elastic.co/u/Filip_2)\
**Post date:** [November 14, 2014, 8:00pm UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/1 "2014-11-14T20:00:39Z")

</div>

Hey there,

I am planning to use only transportClient to connecto to a remote ES  
cluster. Hence I am guessing I don't need the whole elasticsearch jar  
because I am not going to have a local node on my application.  
Is there a mvn artifact to import only java client and not the whole  
elasticsearch application?

Meaning not this one:

org.elasticsearch  
elasticsearch  
${elasticsearch.version}

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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [November 14, 2014, 8:06pm UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/2 "2014-11-14T20:06:25Z")

</div>

No. 🙂

David

> Le 14 nov. 2014 à 21:00, Filip [f.szolno@gmail.com](mailto:f.szolno@gmail.com) a écrit :
> 
> Hey there,
> 
> I am planning to use only transportClient to connecto to a remote ES cluster. Hence I am guessing I don't need the whole elasticsearch jar because I am not going to have a local node on my application.  
> Is there a mvn artifact to import only java client and not the whole elasticsearch application?
> 
> Meaning not this one:
> 
> org.elasticsearch elasticsearch ${elasticsearch.version}
> ## 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com).  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/A828FE56-402D-4EBF-8400-A1AAB499FA9F%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/A828FE56-402D-4EBF-8400-A1AAB499FA9F%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Filip\_2](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@Filip\_2](https://discuss.elastic.co/u/Filip_2)\
**Post date:** [November 14, 2014, 8:22pm UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/3 "2014-11-14T20:22:46Z")

</div>

Oh, ok, I guess I'll just have to send requests via REST. Thank you!

El viernes, 14 de noviembre de 2014 18:06:50 UTC-2, David Pilato escribió:

> No. 🙂
> 
> David
> 
> Le 14 nov. 2014 à 21:00, Filip \<[f.sz...@gmail.com](mailto:f.sz...@gmail.com) \<javascript:\>\> a écrit :
> 
> Hey there,
> 
> I am planning to use only transportClient to connecto to a remote ES  
> cluster. Hence I am guessing I don't need the whole elasticsearch jar  
> because I am not going to have a local node on my application.  
> Is there a mvn artifact to import only java client and not the whole  
> elasticsearch application?
> 
> Meaning not this one:
> 
> org.elasticsearch  
> elasticsearch  
> ${elasticsearch.version}
> 
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/94fd5daa-102f-464f-9f2c-e7071b7ac242%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/94fd5daa-102f-464f-9f2c-e7071b7ac242%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [November 14, 2014, 10:38pm UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/4 "2014-11-14T22:38:42Z")

</div>

Filip,

Or, just put all of the Elasticsearch jars on your local client system,  
then add their containing directory (with "/\*" appended to it) to your  
-classpath, and your client can use the TransportClient. Java will pull in  
exactly what it needs and nothing it doesn't. And your client code stays  
tiny. Works great for us!

Brian

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2fe6afa7-6ff0-4ed6-8792-1909f3ecc3d2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2fe6afa7-6ff0-4ed6-8792-1909f3ecc3d2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [November 15, 2014, 5:24am UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/5 "2014-11-15T05:24:14Z")

</div>

Hi Brian,

I think I'm missing something.  
At the end you still have the full elasticsearch jars, right?  
What is the difference with having that as a maven dependency?

Is it a way for not getting all elasticsearch dependencies which are shaded in elasticsearch jar such as Jackson, Guice,... ?

David

> Le 14 nov. 2014 à 23:38, Brian [brian.from.fl@gmail.com](mailto:brian.from.fl@gmail.com) a écrit :
> 
> Filip,
> 
> Or, just put all of the Elasticsearch jars on your local client system, then add their containing directory (with "/\*" appended to it) to your -classpath, and your client can use the TransportClient. Java will pull in exactly what it needs and nothing it doesn't. And your client code stays tiny. Works great for us!
> 
> ## Brian
> 
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2fe6afa7-6ff0-4ed6-8792-1909f3ecc3d2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2fe6afa7-6ff0-4ed6-8792-1909f3ecc3d2%40googlegroups.com).  
> 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 [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/274D159D-2BE9-45A2-82A9-C0BFD5BB4460%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/274D159D-2BE9-45A2-82A9-C0BFD5BB4460%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [November 15, 2014, 6:14am UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/6 "2014-11-15T06:14:13Z")

</div>

David,

On each machine on which either ES or a client is deployed, we have the  
following directory which contains all of the jars that are packaged with  
ES:

/opt/db/current/elasticsearch-1.3.4/lib  
Then the java command's -classpath includes  
/opt/db/current/elasticsearch-1.3.4/lib/\* (along with our own custom jars  
via /opt/db/lib/\*) and everything works fine.

As for additional 3rd party jars, I have the following:

1. Jackson. The full library is used instead of the one inside ES.
2. Netty. This was needed for my own REST API which hides ES and contains  
the business logic. I couldn't figure out how to easily use the shaded  
version inside ES, and the "real" Netty is as easy to use as falling off a  
log.
3. The LMAX Disruptor .jar file. This thing combines nicely with Netty and  
wow! Netty and application thread counts remain low even under heavy loads.

Everything else I get directly from ES. And I love the way it shades its  
versions of Netty and Jackson so it's very easy for my own app to cherry  
pick what it wants from ES and what it prefers outside of ES.

We could use maven, I suppose, but we don't. Instead, we package all of the  
jars into a zip archive after our application is built against a specific  
ES version. And then that single self-contained zip archive is installed  
where it is needed. And there is no need for an external or internal maven  
repo. Not a big deal for us.

All in all, it's much like how Elasticsearch itself is packaged and  
distributed: A zip archive that I download from the web site. I would never  
use a .deb or .rpm since the version that I want is always on the web site.  
And I believe there is a maven repo but the .zip archive links are right on  
the web site, and we don't update all that often (regularly, but I don't  
thrash our deployment folks).

It sounds complicated, I suppose. But that was only once, and it's been  
easy to manage and develop against, easy to deploy, and makes me look very,  
very good to our deployment folks.

Brian

P.S. I don't use Guice or Spring. I don't see any problem with the new  
operator, and the services I create are fast, rock-solid, easy to configure  
and deploy, and that puts me light-years ahead of much of the pack. But  
this is another topic altogether! 🙂

On Saturday, November 15, 2014 12:24:28 AM UTC-5, David Pilato wrote:

> Hi Brian,
> 
> I think I'm missing something.  
> At the end you still have the full elasticsearch jars, right?  
> What is the difference with having that as a maven dependency?
> 
> Is it a way for not getting all elasticsearch dependencies which are  
> shaded in elasticsearch jar such as Jackson, Guice,... ?
> 
> David

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/01454216-da84-49c0-85e6-62efe4ad535d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/01454216-da84-49c0-85e6-62efe4ad535d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:49am UTC](https://discuss.elastic.co/t/import-java-transportclient-only/20758/7 "2017-07-06T00:49:52Z")

</div>


