git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Guava conflict when using flink kinesis consumer with grpc protobuf


Hi,
I have a dependency on guava in grpc protobuf as follows:

<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>26.0-jre</version>
</dependency>
I also use Flink Kinesis Connector in the same project:
<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-kinesis_${scala.binary.version}</artifactId>
    <version>${flink.version}</version>
</dependency>
This Flink Kinesis connector has a dependency on an older version of guava and this is causing issues with 2 versions of guava being loaded by the classloaders. How do i avoid this issue ?

Details:
While building the Flink Kinesis Connector, I changed the pom.xml to try to shade the guava library but this didn't help.It clearly says in the Flink Kinesis Connector pom.xml to not shade guava.
<relocations combine.children="override">
<!-- DO NOT RELOCATE GUAVA IN THIS PACKAGE -->
<relocation>
<pattern>com.google.protobuf</pattern>
<shadedPattern>org.apache.flink.kinesis.shaded.com.google.protobuf</shadedPattern>
</relocation> .....
Attempted following in my project's pom.xml but didn't work:

<relocations combine.children="override">
<!-- DO NOT RELOCATE GUAVA IN THIS PACKAGE -->
<relocation>
<pattern>com.google.guava</pattern>
<shadedPattern>org.apache.flink.kinesis.shaded.com.google.guava</shadedPattern>
</relocation> ..

Using JDK 8
TIA,