diff --git a/build.gradle b/build.gradle index 6c4506ac..75c2a841 100644 --- a/build.gradle +++ b/build.gradle @@ -30,14 +30,17 @@ allprojects { } dependencies { - compile 'net.sourceforge.argparse4j:argparse4j:0.5.0' - compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.0' - compile 'org.apache.avro:avro:1.4.1' - compile 'org.json:json:20140107' + compile 'net.sourceforge.argparse4j:argparse4j:0.9.0' + compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2' + compile 'org.apache.avro:avro:1.11.0' + compile 'org.json:json:20220320' compile 'org.jolokia:jolokia-jvm:1.6.2' compile 'net.savantly:graphite-client:1.1.0-RELEASE' compile 'com.timgroup:java-statsd-client:3.0.1' - compile 'com.signalfx.public:signalfx-codahale:0.0.47' + compile 'com.signalfx.public:signalfx-codahale:1.0.17' + compile 'com.fasterxml.jackson.module:jackson-module-scala_2.12:2.13.2' + compile 'io.netty:netty-handler:4.1.76.Final' + compile 'org.apache.commons:commons-lang3:3.12.0' compile group: 'org.apache.kafka', name: 'kafka_2.12', version: '2.7.1' compile group: 'org.apache.kafka', name: 'kafka-clients', version: '2.7.1' testCompile 'org.mockito:mockito-core:2.24.0' diff --git a/docker/Dockerfile b/docker/Dockerfile index baff1023..081cda12 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,10 +11,12 @@ # limitations under the License. -FROM anapsix/alpine-java +FROM azul/zulu-openjdk-alpine:8-jre MAINTAINER coffeepac@gmail.com +RUN apk add --no-cache bash + WORKDIR /opt/kafka-monitor ADD build/ build/ ADD bin/xinfra-monitor-start.sh bin/xinfra-monitor-start.sh diff --git a/docker/kafka-monitor-docker-entry.sh b/docker/kafka-monitor-docker-entry.sh index 97554bb0..77b791b3 100755 --- a/docker/kafka-monitor-docker-entry.sh +++ b/docker/kafka-monitor-docker-entry.sh @@ -24,4 +24,4 @@ sleep 10 bin/xinfra-monitor-start.sh config/xinfra-monitor.properties & -wait $! \ No newline at end of file +wait $! diff --git a/src/main/java/com/linkedin/xinfra/monitor/common/Utils.java b/src/main/java/com/linkedin/xinfra/monitor/common/Utils.java index 4a6db971..d7fd07ac 100644 --- a/src/main/java/com/linkedin/xinfra/monitor/common/Utils.java +++ b/src/main/java/com/linkedin/xinfra/monitor/common/Utils.java @@ -37,7 +37,7 @@ import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.generic.GenericRecord; import org.apache.avro.io.Encoder; -import org.apache.avro.io.JsonEncoder; +import org.apache.avro.io.EncoderFactory; import org.apache.kafka.clients.admin.AdminClient; import org.apache.kafka.clients.admin.CreateTopicsResult; import org.apache.kafka.clients.admin.ListPartitionReassignmentsResult; @@ -240,7 +240,7 @@ public static String jsonFromGenericRecord(GenericRecord record) { GenericDatumWriter writer = new GenericDatumWriter<>(DefaultTopicSchema.MESSAGE_V0); try { - Encoder encoder = new JsonEncoder(DefaultTopicSchema.MESSAGE_V0, out); + Encoder encoder = EncoderFactory.get().jsonEncoder(DefaultTopicSchema.MESSAGE_V0, out); writer.write(record, encoder); encoder.flush(); } catch (IOException e) { diff --git a/src/main/java/com/linkedin/xinfra/monitor/services/GraphiteMetricsReporterService.java b/src/main/java/com/linkedin/xinfra/monitor/services/GraphiteMetricsReporterService.java index 043f34b5..24512d7d 100644 --- a/src/main/java/com/linkedin/xinfra/monitor/services/GraphiteMetricsReporterService.java +++ b/src/main/java/com/linkedin/xinfra/monitor/services/GraphiteMetricsReporterService.java @@ -23,7 +23,7 @@ import net.savantly.graphite.GraphiteClient; import net.savantly.graphite.GraphiteClientFactory; import net.savantly.graphite.impl.SimpleCarbonMetric; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/linkedin/xinfra/monitor/services/OffsetCommitService.java b/src/main/java/com/linkedin/xinfra/monitor/services/OffsetCommitService.java index 6a468027..ceae0445 100644 --- a/src/main/java/com/linkedin/xinfra/monitor/services/OffsetCommitService.java +++ b/src/main/java/com/linkedin/xinfra/monitor/services/OffsetCommitService.java @@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import kafka.tools.ConsoleProducer; import org.apache.kafka.clients.ApiVersions; import org.apache.kafka.clients.ClientDnsLookup; import org.apache.kafka.clients.ClientResponse; @@ -40,7 +39,6 @@ import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient; import org.apache.kafka.clients.consumer.internals.RequestFuture; -import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.Node; import org.apache.kafka.common.internals.ClusterResourceListeners; import org.apache.kafka.common.message.OffsetCommitRequestData; diff --git a/src/main/java/com/linkedin/xinfra/monitor/services/SignalFxMetricsReporterService.java b/src/main/java/com/linkedin/xinfra/monitor/services/SignalFxMetricsReporterService.java index 9678ed10..e84f1200 100644 --- a/src/main/java/com/linkedin/xinfra/monitor/services/SignalFxMetricsReporterService.java +++ b/src/main/java/com/linkedin/xinfra/monitor/services/SignalFxMetricsReporterService.java @@ -19,7 +19,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/linkedin/xinfra/monitor/services/StatsdMetricsReporterService.java b/src/main/java/com/linkedin/xinfra/monitor/services/StatsdMetricsReporterService.java index 079beb78..77ce1307 100644 --- a/src/main/java/com/linkedin/xinfra/monitor/services/StatsdMetricsReporterService.java +++ b/src/main/java/com/linkedin/xinfra/monitor/services/StatsdMetricsReporterService.java @@ -20,7 +20,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory;