Bump the version of kafka-clients dependency to 3.0.0 44/130044/3
authorRashmi Pujar <rashmi.pujar1@bell.ca>
Wed, 27 Jul 2022 15:44:04 +0000 (11:44 -0400)
committerRashmi Pujar <rashmi.pujar1@bell.ca>
Thu, 28 Jul 2022 19:23:00 +0000 (15:23 -0400)
The issue was observed when APEX fails to consume events from
a Kafka topic when message compression is used specifically snappy.

APEX KafkaConsumer uses snappy-java library (transitive
dependency from kafka-clients) to consume events with snappy
compression. The snappy-java jar packages the native
library (built against glibc) which can be overwritten
to use alpine compatible native library (built using musl).
This means we will need to install the java-snappy-package in apex-pdp
which is also added to the commit as an option.

Alternatively, in later version of snappy-java dependency (1.1.8)
there is an option to use Java implementation instead of native
library as per:
https://github.com/xerial/snappy-java#using-pure-java-snappy-implementation.
This is a cleaner solution to fix the issue.

Issue-ID: POLICY-4310
Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca>
Change-Id: Ic92b1d429ca3ca0cd1cd7070cd8d102df58b1420

packages/apex-pdp-docker/src/main/docker/Dockerfile
pom.xml
testsuites/integration/integration-uservice-test/pom.xml

index f1b0234..0fee7d4 100644 (file)
@@ -35,6 +35,7 @@ RUN apk add --no-cache \
         vim \
         iproute2 \
         iputils \
+        java-snappy-native \
     && addgroup -S apexuser && adduser -S apexuser -G apexuser \
     && mkdir -p $POLICY_HOME \
     && mkdir -p $POLICY_LOGS \
diff --git a/pom.xml b/pom.xml
index 3401e6c..4f25ee9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
    Copyright (C) 2018 Ericsson. All rights reserved.
    Modifications Copyright (C) 2019-2020 Nordix Foundation.
    Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
-   Modifications Copyright (C) 2020-2021 Bell Canada.
+   Modifications Copyright (C) 2020-2022 Bell Canada.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@
         <encoding>UTF-8</encoding>
         <file.encoding>UTF-8</file.encoding>
         <version.commons-cli>1.4</version.commons-cli>
-        <version.kafka>2.3.0</version.kafka>
+        <version.kafka>3.0.0</version.kafka>
         <version.hibernate>5.3.7.Final</version.hibernate>
         <version.policy.common>1.8.3-SNAPSHOT</version.policy.common>
         <version.policy.models>2.4.6-SNAPSHOT</version.policy.models>
 
     <profiles>
         <profile>
-            <!--This profile is used to store Eclipse m2e settings only. It has no 
+            <!--This profile is used to store Eclipse m2e settings only. It has no
                 influence on the Maven build itself. -->
             <id>only-eclipse</id>
             <activation>
index ff53e65..0f0d624 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
    Copyright (C) 2018 Ericsson. All rights reserved.
    Modifications Copyright (C) 2019-2020 Nordix Foundation.
-   Modifications Copyright (C) 2020 Bell Canada.
+   Modifications Copyright (C) 2020, 2022 Bell Canada.
    Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
         <dependency>
             <groupId>com.salesforce.kafka.test</groupId>
             <artifactId>kafka-junit4</artifactId>
-            <version>3.2.1</version>
+            <version>3.2.3</version>
             <scope>test</scope>
             <exclusions>
             <!-- The default netty version in kafka-junit4 has vulnerabilities -->
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper</artifactId>
+            <version>3.7.0</version>
+            <scope>test</scope>
+            <exclusions>
+                <!-- The default netty version in kafka-junit4 has vulnerabilities -->
+                <exclusion>
+                    <groupId>io.netty</groupId>
+                    <artifactId>*</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
         <!-- This netty version fixes the vulnerabilities -->
         <dependency>
             <groupId>io.netty</groupId>