From 84e9b7618b87c8566aba9cdc97c2c8073b8b8680 Mon Sep 17 00:00:00 2001 From: Jean Bisutti Date: Wed, 3 Jul 2024 18:22:52 +0200 Subject: [PATCH] Add GraalVM Kafka hints (#11735) --- .../spring/smoketest/RuntimeHints.java | 5 +- .../META-INF/native-image/reflect-config.json | 701 ++++++++++++++++++ 2 files changed, 702 insertions(+), 4 deletions(-) diff --git a/smoke-tests-otel-starter/spring-boot-3/src/main/java/io/opentelemetry/spring/smoketest/RuntimeHints.java b/smoke-tests-otel-starter/spring-boot-3/src/main/java/io/opentelemetry/spring/smoketest/RuntimeHints.java index e2b01cc7d840..85da65c58417 100644 --- a/smoke-tests-otel-starter/spring-boot-3/src/main/java/io/opentelemetry/spring/smoketest/RuntimeHints.java +++ b/smoke-tests-otel-starter/spring-boot-3/src/main/java/io/opentelemetry/spring/smoketest/RuntimeHints.java @@ -24,9 +24,6 @@ public void registerHints( .registerType( TypeReference.of( "org.springframework.data.mongodb.core.aggregation.AggregationOperation"), - hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)) - .registerType( - TypeReference.of("org.apache.kafka.common.serialization.StringDeserializer"), - hint -> hint.withMembers(MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)); + hint -> hint.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)); } } diff --git a/smoke-tests-otel-starter/spring-boot-common/src/main/resources/META-INF/native-image/reflect-config.json b/smoke-tests-otel-starter/spring-boot-common/src/main/resources/META-INF/native-image/reflect-config.json index ce3d6a3b14ad..231822ff1cf2 100644 --- a/smoke-tests-otel-starter/spring-boot-common/src/main/resources/META-INF/native-image/reflect-config.json +++ b/smoke-tests-otel-starter/spring-boot-common/src/main/resources/META-INF/native-image/reflect-config.json @@ -544,5 +544,706 @@ "typeReachable": "com.zaxxer.hikari.util.Sequence$Factory" }, "name": "java.util.concurrent.atomic.LongAdder" + }, + , + { + "name": "org.apache.kafka.clients.consumer.CooperativeStickyAssignor", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.clients.consumer.RangeAssignor", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.clients.consumer.RoundRobinAssignor", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.clients.consumer.StickyAssignor", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.ConsumerPartitionAssignor" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.clients.producer.RoundRobinPartitioner", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.metrics.JmxReporter", + "condition": { + "typeReachable": "org.apache.kafka.common.utils.Utils" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.security.authenticator.AbstractLogin$DefaultLoginCallbackHandler", + "condition": { + "typeReachable": "org.apache.kafka.common.security.authenticator.LoginManager" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.security.authenticator.DefaultLogin", + "condition": { + "typeReachable": "org.apache.kafka.common.security.authenticator.LoginManager" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.security.authenticator.SaslClientCallbackHandler", + "condition": { + "typeReachable": "org.apache.kafka.common.network.SaslChannelBuilder" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.security.plain.PlainLoginModule", + "condition": { + "typeReachable": "org.apache.kafka.common.security.authenticator.AbstractLogin" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.BooleanDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.BooleanSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ByteArrayDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ByteArraySerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ByteBufferDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ByteBufferSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.BytesDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.BytesSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.DoubleDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.DoubleSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.FloatDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.FloatSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.IntegerDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.IntegerSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ListDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ListSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.LongDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.LongSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$BooleanSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListDeserializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$BooleanSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$ByteArraySerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$ByteBufferSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$BytesSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$DoubleSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$FloatSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$IntegerSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$LongSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$ShortSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$StringSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$UUIDSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.Serdes$VoidSerde", + "condition": { + "typeReachable": "org.apache.kafka.common.serialization.ListSerializer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ShortDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.ShortSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.StringDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.StringSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.UUIDDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.UUIDSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.VoidDeserializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.consumer.KafkaConsumer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.serialization.VoidSerializer", + "condition": { + "typeReachable": "org.apache.kafka.clients.producer.KafkaProducer" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org.apache.kafka.common.utils.AppInfoParser$AppInfo", + "queryAllPublicConstructors": true, + "condition": { + "typeReachable": "org.apache.kafka.common.utils.AppInfoParser" + } + }, + { + "name": "org.apache.kafka.common.utils.AppInfoParser$AppInfoMBean", + "queryAllPublicMethods": true, + "condition": { + "typeReachable": "org.apache.kafka.common.utils.AppInfoParser" + } } ]