|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2023 the original author or authors. |
| 2 | + * Copyright 2012-2025 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
24 | 24 | import org.apache.kafka.clients.consumer.ConsumerConfig;
|
25 | 25 | import org.apache.kafka.clients.producer.ProducerConfig;
|
26 | 26 |
|
| 27 | +import org.springframework.aot.hint.MemberCategory; |
| 28 | +import org.springframework.aot.hint.RuntimeHints; |
| 29 | +import org.springframework.aot.hint.RuntimeHintsRegistrar; |
27 | 30 | import org.springframework.beans.factory.ObjectProvider;
|
28 | 31 | import org.springframework.boot.autoconfigure.AutoConfiguration;
|
29 | 32 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
38 | 41 | import org.springframework.boot.ssl.SslBundles;
|
39 | 42 | import org.springframework.context.annotation.Bean;
|
40 | 43 | import org.springframework.context.annotation.Import;
|
| 44 | +import org.springframework.context.annotation.ImportRuntimeHints; |
41 | 45 | import org.springframework.kafka.core.ConsumerFactory;
|
42 | 46 | import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
|
43 | 47 | import org.springframework.kafka.core.DefaultKafkaProducerFactory;
|
|
73 | 77 | @ConditionalOnClass(KafkaTemplate.class)
|
74 | 78 | @EnableConfigurationProperties(KafkaProperties.class)
|
75 | 79 | @Import({ KafkaAnnotationDrivenConfiguration.class, KafkaStreamsAnnotationDrivenConfiguration.class })
|
| 80 | +@ImportRuntimeHints(KafkaAutoConfiguration.KafkaRuntimeHints.class) |
76 | 81 | public class KafkaAutoConfiguration {
|
77 | 82 |
|
78 | 83 | private final KafkaProperties properties;
|
@@ -230,4 +235,13 @@ private static void setBackOffPolicy(RetryTopicConfigurationBuilder builder, Top
|
230 | 235 | }
|
231 | 236 | }
|
232 | 237 |
|
| 238 | + static class KafkaRuntimeHints implements RuntimeHintsRegistrar { |
| 239 | + |
| 240 | + @Override |
| 241 | + public void registerHints(RuntimeHints hints, ClassLoader classLoader) { |
| 242 | + hints.reflection().registerType(SslBundleSslEngineFactory.class, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS); |
| 243 | + } |
| 244 | + |
| 245 | + } |
| 246 | + |
233 | 247 | }
|
0 commit comments