5.0 alpha 5 Java API: PreBuiltTransportClient class missing


(Celio Nogueira de Faria Jr) #1

Hi,

I'm trying to use the ES 5.0 alpha 5 Java API (maven dependency), but cannot find the PreBuiltTransportClient class (as described in https://www.elastic.co/guide/en/elasticsearch/client/java-api/master/transport-client.html. Any clues?

Thanks,

Célio.


(Jason Tedor) #2

It's a separate dependency with coordinates org.elasticsearch.client:transport:5.0.0-alpha5.


Elasticsearch Java Client
#3

I just downloaded the binary distribution for 5.0.0 (October 27th 2016) and I'm unable to find this method anywhere in the entire distribution.

Specifically, I pulled down the tar.gz build. Is this binary not the official release? If so, what am I missing?

Thanks


(David Pilato) #4

May be this?

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_maven_repository.html

<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>transport</artifactId>
    <version>5.0.0</version>
</dependency>

#5

Hi dadoonet, I didn't mention that I'm not using maven. I'm using the pre-built distribution. I would assume that everything would be included there. The elasticsearch.jar does have a client.transport package in it, but the PreBuiltTransportClient class is not in the build.

Are you saying that, even if I'm using the binary distribution, I still have to pull down further dependencies? Doesn't that kinda defeat the purpose of providing pre-built binaries? :slight_smile:

Thanks


(David Pilato) #6

If you were using Maven and importing the org.elasticsearch.client:transport lib in your project you would see that it depends on org.elasticsearch:elasticsearch as well + other libs. See the list here: https://repo1.maven.org/maven2/org/elasticsearch/client/transport/5.0.0/transport-5.0.0.pom

Every single lib listed here also come with their own dependencies.

Using a dependency managing system like Maven or Gradle would help you a lot finding all the needed deps.


#7

Hi David,

I agree 100%. Unfortunately, my company requires that we get permission to use every single product we use within our application and therefore does not allow the use of Maven since they can't control what libs are being used. It's all part of their policing the licenses for the packages we use. It's a real pain in the behind, but it is what it is.

With that said, I do now see what you mean in so far as needing the extra dependencies. Specifically the transport type being used, etc. That will help me grab those and make sure they are approved for use.

Thanks


(David Pilato) #8

I worked with such a company policy historically. The deal we made was that you can use Maven and a enterprise Maven repo (Sonatype for example), and then just add authorized libs in there.

The use maven as a normal dependency manager. If you can't access to a lib when you run mvn install, then you can decide what you need to do:

  • remove the lib you don't want to use
  • add authorization to add this lib to your company policy

Another way for doing that (and we went to that path) is to allow everything from the company repository but people in charge of the policy can run audits on the repository and see what libs are used and if they are compatible with the policy. Which means as well that every project which uses Maven need to publish their project on the company repository so you can link all that together.

In short, maven/gradle is not the problem here.

Coming back to your problem, just create a minimalistic maven project at home, then add the transport lib as explained in our docs and launch mvn dependency:tree. You'll get the list of the dependencies you manually need to add.

HTH


(system) #9