Shade grpc dependency

Posted by mangalaman93:

If we shade the grpc dependency of Java client, it would avoid conflicts with a different version of grpc dependency that user code might have. I have faced these issues with Spark (or MapR), spark internally uses its own grpc version that will, for sure, conflict with java client. Shading, will solve this problem permanently. We will have to figure out a way to serve the shaded jar as production jar, though.

1 Like

I had to shade dgraph4j and its dependencies for the Spark Dgraph Connector to work with spark-submit, which bloated my package from 531 KB to 7.7 MB. Each new release of the connector will re-distribute possibly the same dependencies.

A dgraph4j dependency with shaded grpc dependencies would be great!

I have created a shaded Dgraph4j artifact in Maven, to be reused by any package an version, which reduces my package size back down to 648 KB: https://mvnrepository.com/artifact/uk.co.gresearch.dgraph/dgraph4j-shaded

Hoping to move this shaded package back into the io.dgraph namespace: Provide shaded jar with dgraph4j's dependencies by EnricoMi · Pull Request #239 · dgraph-io/dgraph4j · GitHub

1 Like