|
25 | 25 | import org.apache.kafka.clients.producer.ProducerConfig;
|
26 | 26 | import org.apache.kafka.common.config.SslConfigs;
|
27 | 27 |
|
| 28 | +import org.springframework.aot.hint.MemberCategory; |
| 29 | +import org.springframework.aot.hint.RuntimeHints; |
| 30 | +import org.springframework.aot.hint.RuntimeHintsRegistrar; |
28 | 31 | import org.springframework.beans.factory.ObjectProvider;
|
29 | 32 | import org.springframework.boot.autoconfigure.AutoConfiguration;
|
30 | 33 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
42 | 45 | import org.springframework.boot.ssl.SslBundles;
|
43 | 46 | import org.springframework.context.annotation.Bean;
|
44 | 47 | import org.springframework.context.annotation.Import;
|
| 48 | +import org.springframework.context.annotation.ImportRuntimeHints; |
45 | 49 | import org.springframework.kafka.core.ConsumerFactory;
|
46 | 50 | import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
|
47 | 51 | import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
|
78 | 82 | @ConditionalOnClass(KafkaTemplate.class)
|
79 | 83 | @EnableConfigurationProperties(KafkaProperties.class)
|
80 | 84 | @Import({ KafkaAnnotationDrivenConfiguration.class, KafkaStreamsAnnotationDrivenConfiguration.class })
|
| 85 | +@ImportRuntimeHints(KafkaAutoConfiguration.KafkaRuntimeHints.class) |
81 | 86 | public class KafkaAutoConfiguration {
|
82 | 87 |
|
83 | 88 | private final KafkaProperties properties;
|
@@ -249,4 +254,13 @@ static void applySecurityProtocol(Map<String, Object> properties, String securit
|
249 | 254 | }
|
250 | 255 | }
|
251 | 256 |
|
| 257 | + static class KafkaRuntimeHints implements RuntimeHintsRegistrar { |
| 258 | + |
| 259 | + @Override |
| 260 | + public void registerHints(RuntimeHints hints, ClassLoader classLoader) { |
| 261 | + hints.reflection().registerType(SslBundleSslEngineFactory.class, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS); |
| 262 | + } |
| 263 | + |
| 264 | + } |
| 265 | + |
252 | 266 | }
|
0 commit comments