io.quarkus.kafka.client.runtime.graal.SubstituteSnappy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-kafka-client Show documentation
Show all versions of quarkus-kafka-client Show documentation
Connect to Apache Kafka with its native API
package io.quarkus.kafka.client.runtime.graal;
import java.util.List;
import java.util.Map;
import org.apache.kafka.common.metrics.JmxReporter;
import org.apache.kafka.common.metrics.KafkaMetric;
import org.apache.kafka.common.metrics.Metrics;
import org.apache.kafka.common.utils.AppInfoParser;
import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;
/**
* Here is where surgery happens
* * Remove JMX
*/
@TargetClass(value = AppInfoParser.class)
final class RemoveJMXAccess {
@Substitute
public static synchronized void registerAppInfo(String prefix, String id, Metrics metrics, long nowMs) {
registerMetrics(metrics, new AppInfoParser.AppInfo(nowMs));
}
@Substitute
public static synchronized void unregisterAppInfo(String prefix, String id, Metrics metrics) {
unregisterMetrics(metrics);
}
@Alias
private native static void registerMetrics(Metrics metrics, AppInfoParser.AppInfo appInfo);
@Alias
private native static void unregisterMetrics(Metrics metrics);
}
@TargetClass(value = JmxReporter.class)
final class JMXReporting {
@Substitute
public void reconfigure(Map configs) {
}
@Substitute
public void init(List metrics) {
}
@Substitute
public void metricChange(KafkaMetric metric) {
}
@Substitute
public void metricRemoval(KafkaMetric metric) {
}
@Substitute
public void close() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy