Skip to content

Commit 1682709

Browse files
authored
Merge pull request #13 from vivetiwa/upgrade-kafka-version-java-11
Upgrade kafka version java 11
2 parents 2a9361f + 5d252bc commit 1682709

File tree

8 files changed

+52
-12
lines changed

8 files changed

+52
-12
lines changed

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# governing permissions and limitations under the License.
1111
##
1212

13-
FROM anapsix/alpine-java:jdk8
13+
FROM adoptopenjdk/openjdk11:jre-11.0.11_9-alpine
1414

1515
ENV SCALA_VERSION="2.12" \
16-
KAFKA_VERSION="2.3.0"
16+
KAFKA_VERSION="2.8.0"
1717
ENV KAFKA_HOME=/opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION}
1818

1919
ARG KAFKA_DIST=kafka_${SCALA_VERSION}-${KAFKA_VERSION}
@@ -23,7 +23,7 @@ ARG KAFKA_DIST_ASC=${KAFKA_DIST}.tgz.asc
2323
RUN set -x && \
2424
apk add --no-cache unzip curl ca-certificates gnupg jq && \
2525
eval $(gpg-agent --daemon) && \
26-
MIRROR=`curl -sSL https://www.apache.org/dyn/closer.cgi\?as_json\=1 | jq -r '.preferred'` && \
26+
MIRROR=`curl -sSL https://www.apache.org/dyn/closer.cgi\?as_json\=1 | jq -r '.http[0]'` && \
2727
curl -sSLO "${MIRROR}kafka/${KAFKA_VERSION}/${KAFKA_DIST_TGZ}" && \
2828
curl -sSLO https://dist.apache.org/repos/dist/release/kafka/${KAFKA_VERSION}/${KAFKA_DIST_ASC} && \
2929
curl -sSL https://kafka.apache.org/KEYS | gpg -q --import - && \
@@ -32,11 +32,13 @@ RUN set -x && \
3232
mv ${KAFKA_DIST_TGZ} /tmp && \
3333
tar xfz /tmp/${KAFKA_DIST_TGZ} -C /opt && \
3434
rm /tmp/${KAFKA_DIST_TGZ} && \
35-
apk del unzip ca-certificates gnupg
35+
apk del unzip ca-certificates gnupg && \
36+
apk add bash
3637

3738
ENV PATH=$PATH:/${KAFKA_HOME}/bin \
3839
CONNECT_CFG=${KAFKA_HOME}/config/connect-distributed.properties \
39-
CONNECT_BIN=${KAFKA_HOME}/bin/connect-distributed.sh
40+
CONNECT_BIN=${KAFKA_HOME}/bin/connect-distributed.sh \
41+
CONNECT_LOG_CFG=$KAFKA_HOME/config/log4j.properties
4042

4143
ENV CONNECT_PORT=8083
4244
ENV EXTRA_ARGS="-javaagent:$KAFKA_HOME/connectors/jmx_prometheus_javaagent-0.12.0.jar=9999:${KAFKA_HOME}/config/prometheus.yml"

build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ subprojects {
4949
version = System.getenv("PROJECT_VERSION") ?: "${versionMain}${versionQualifier}"
5050

5151
checkstyle {
52-
configFile = '../config/checkstyle/checkstyle.xml' as File
52+
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
53+
configProperties 'checkstyle.header.file': file('../config/checkstyle/adobe.header.txt')
5354
maxWarnings = 0
5455
toolVersion '8.10.1'
5556
}
@@ -101,7 +102,7 @@ subprojects {
101102
}
102103

103104
jacoco {
104-
toolVersion = "0.8.1"
105+
toolVersion = "0.8.6"
105106
}
106107

107108
jacocoTestReport {

config/checkstyle/checkstyle.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- governing permissions and limitations under the License.-->
1212
<!DOCTYPE module PUBLIC
1313
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
14-
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
14+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
1515

1616
<module name="Checker">
1717
<property name="charset" value="UTF-8"/>
@@ -29,7 +29,7 @@
2929
<module name="NewlineAtEndOfFile"/>
3030

3131
<module name="RegexpHeader">
32-
<property name="headerFile" value="config/checkstyle/adobe.header.txt"/>
32+
<property name="headerFile" value="${checkstyle.header.file}"/>
3333
</module>
3434

3535
<module name="TreeWalker">

dependencies.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ versions.jmxPrometheusJavaAgent = '0.12.0'
2626
versions.junitJupiter = '5.2.0'
2727
versions.jjwt = '0.9.0'
2828
versions.orgJson = '20180130'
29-
versions.kafkaConnect = '2.3.0'
29+
versions.kafkaConnect = '2.8.0'
3030
versions.slf4j = '1.7.25'
31+
versions.jaxb = '2.3.0'
3132

3233
libraries.collections4 = [
3334
"org.apache.commons:commons-collections4:$versions.collections4"
@@ -84,3 +85,7 @@ libraries.orgJson = [
8485
libraries.slf4j = [
8586
"org.slf4j:slf4j-api:$versions.slf4j"
8687
]
88+
89+
libraries.jaxb = [
90+
"javax.xml.bind:jaxb-api:$versions.jaxb"
91+
]

docker-entrypoint.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,37 @@ export KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote=true \
4747
-Dcom.sun.management.jmxremote.authenticate=false \
4848
-Dcom.sun.management.jmxremote.ssl=false"
4949

50+
#
51+
# Configure the log files ...
52+
#
53+
if [[ -n "$CONNECT_LOG4J_LOGGERS" ]]; then
54+
sed -i -r -e "s|^(log4j.rootLogger)=.*|\1=${CONNECT_LOG4J_LOGGERS}|g" $CONNECT_LOG_CFG
55+
unset CONNECT_LOG4J_LOGGERS
56+
fi
57+
env | grep '^CONNECT_LOG4J' | while read -r VAR;
58+
do
59+
env_var=`echo "$VAR" | sed -r "s/([^=]*)=.*/\1/g"`
60+
prop_name=`echo "$VAR" | sed -r "s/^CONNECT_([^=]*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .`
61+
prop_value=`echo "$VAR" | sed -r "s/^CONNECT_[^=]*=(.*)/\1/g"`
62+
if egrep -q "(^|^#)$prop_name=" $CONNECT_LOG_CFG; then
63+
#note that no config names or values may contain an '@' char
64+
sed -r -i "s@(^|^#)($prop_name)=(.*)@\2=${prop_value}@g" $CONNECT_LOG_CFG
65+
else
66+
echo "$prop_name=${prop_value}" >> $CONNECT_LOG_CFG
67+
fi
68+
if [[ "$SENSITIVE_PROPERTIES" = *"$env_var"* ]]; then
69+
echo "--- Setting logging property from $env_var: $prop_name=[hidden]"
70+
else
71+
echo "--- Setting logging property from $env_var: $prop_name=${prop_value}"
72+
fi
73+
unset $env_var
74+
done
75+
76+
if [[ -n "$LOG_LEVEL" ]]; then
77+
sed -i -r -e "s|=INFO, stdout|=$LOG_LEVEL, stdout|g" $CONNECT_LOG_CFG
78+
sed -i -r -e "s|^(log4j.appender.stdout.threshold)=.*|\1=${LOG_LEVEL}|g" $CONNECT_LOG_CFG
79+
fi
80+
5081
# Extend CLASSPATH for custom connectors
5182
export CLASSPATH=${CLASSPATH}:${KAFKA_HOME}/connectors/*
5283

streaming-connect-common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ apply from: '../dependencies.gradle'
1414

1515
dependencies {
1616
libraries.with {
17-
compile collections4, commonslang, guava, httpClient, jackson, jmockit, junitJupiter, jjwt, orgJson, slf4j
17+
compile collections4, commonslang, guava, httpClient, jackson, jmockit, junitJupiter, jjwt, orgJson, slf4j, jaxb
1818
testCompile jmockit, junitJupiter
1919
}
2020
}

streaming-connect-common/src/test/java/com/adobe/platform/streaming/auth/impl/JWTTokenProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
class JWTTokenProviderTest {
2424

25-
private static final String ENDPOINT = "https://ims-na1-stg1.adobelogin.com";
25+
private static final String ENDPOINT = "https://ims-na1.adobelogin.com";
2626
private static final String TEST_CLIENT = "testClientId";
2727
private static final String TEST_ORG = "testImsOrg";
2828
private static final String TEST_ACCOUNT_ID = "testTechnicalAccountId";

streaming-connect-sink/src/test/java/com/adobe/platform/streaming/sink/utils/SinkUtilsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ void testGetPropertyWithMultiplier() {
5858
));
5959
}
6060
}
61+

0 commit comments

Comments
 (0)