Import java transportClient only

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Import java transportClient only

Filip-2
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:

<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>

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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Import java transportClient only

dadoonet
No. :)

David

Le 14 nov. 2014 à 21:00, Filip <[hidden email]> 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:

<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>

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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com.
For more options, visit 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/A828FE56-402D-4EBF-8400-A1AAB499FA9F%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Import java transportClient only

Filip-2
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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="pFA8_31WGJEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">f.sz...@...> 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:

<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>

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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="pFA8_31WGJEJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">elasticsearc...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" onmousedown="this.href='https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;" onclick="this.href='https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com?utm_medium\75email\46utm_source\75footer';return true;">https://groups.google.com/d/msgid/elasticsearch/b5252865-d555-42bf-b84b-215cb73d8a08%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/94fd5daa-102f-464f-9f2c-e7071b7ac242%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Import java transportClient only

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

Re: Import java transportClient only

dadoonet
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 <[hidden email]> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2fe6afa7-6ff0-4ed6-8792-1909f3ecc3d2%40googlegroups.com.
For more options, visit 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/274D159D-2BE9-45A2-82A9-C0BFD5BB4460%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Import java transportClient only

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