3838import org .springframework .boot .context .properties .PropertyMapper ;
3939import org .springframework .boot .context .properties .source .MutuallyExclusiveConfigurationPropertiesException ;
4040import org .springframework .boot .convert .DurationUnit ;
41- import org .springframework .boot .ssl .SslBundles ;
4241import org .springframework .core .io .Resource ;
4342import org .springframework .kafka .listener .ContainerProperties .AckMode ;
4443import org .springframework .kafka .security .jaas .KafkaJaasLoginModuleInitializer ;
@@ -162,15 +161,15 @@ public Retry getRetry() {
162161 return this .retry ;
163162 }
164163
165- private Map <String , Object > buildCommonProperties (SslBundles sslBundles ) {
164+ private Map <String , Object > buildCommonProperties () {
166165 Map <String , Object > properties = new HashMap <>();
167166 if (this .bootstrapServers != null ) {
168167 properties .put (CommonClientConfigs .BOOTSTRAP_SERVERS_CONFIG , this .bootstrapServers );
169168 }
170169 if (this .clientId != null ) {
171170 properties .put (CommonClientConfigs .CLIENT_ID_CONFIG , this .clientId );
172171 }
173- properties .putAll (this .ssl .buildProperties (sslBundles ));
172+ properties .putAll (this .ssl .buildProperties ());
174173 properties .putAll (this .security .buildProperties ());
175174 if (!CollectionUtils .isEmpty (this .properties )) {
176175 properties .putAll (this .properties );
@@ -187,21 +186,8 @@ private Map<String, Object> buildCommonProperties(SslBundles sslBundles) {
187186 * instance
188187 */
189188 public Map <String , Object > buildConsumerProperties () {
190- return buildConsumerProperties (null );
191- }
192-
193- /**
194- * Create an initial map of consumer properties from the state of this instance.
195- * <p>
196- * This allows you to add additional properties, if necessary, and override the
197- * default {@code kafkaConsumerFactory} bean.
198- * @param sslBundles bundles providing SSL trust material
199- * @return the consumer properties initialized with the customizations defined on this
200- * instance
201- */
202- public Map <String , Object > buildConsumerProperties (SslBundles sslBundles ) {
203- Map <String , Object > properties = buildCommonProperties (sslBundles );
204- properties .putAll (this .consumer .buildProperties (sslBundles ));
189+ Map <String , Object > properties = buildCommonProperties ();
190+ properties .putAll (this .consumer .buildProperties ());
205191 return properties ;
206192 }
207193
@@ -214,21 +200,8 @@ public Map<String, Object> buildConsumerProperties(SslBundles sslBundles) {
214200 * instance
215201 */
216202 public Map <String , Object > buildProducerProperties () {
217- return buildProducerProperties (null );
218- }
219-
220- /**
221- * Create an initial map of producer properties from the state of this instance.
222- * <p>
223- * This allows you to add additional properties, if necessary, and override the
224- * default {@code kafkaProducerFactory} bean.
225- * @param sslBundles bundles providing SSL trust material
226- * @return the producer properties initialized with the customizations defined on this
227- * instance
228- */
229- public Map <String , Object > buildProducerProperties (SslBundles sslBundles ) {
230- Map <String , Object > properties = buildCommonProperties (sslBundles );
231- properties .putAll (this .producer .buildProperties (sslBundles ));
203+ Map <String , Object > properties = buildCommonProperties ();
204+ properties .putAll (this .producer .buildProperties ());
232205 return properties ;
233206 }
234207
@@ -237,27 +210,25 @@ public Map<String, Object> buildProducerProperties(SslBundles sslBundles) {
237210 * <p>
238211 * This allows you to add additional properties, if necessary, and override the
239212 * default {@code kafkaAdmin} bean.
240- * @param sslBundles bundles providing SSL trust material
241213 * @return the admin properties initialized with the customizations defined on this
242214 * instance
243215 */
244- public Map <String , Object > buildAdminProperties (SslBundles sslBundles ) {
245- Map <String , Object > properties = buildCommonProperties (sslBundles );
246- properties .putAll (this .admin .buildProperties (sslBundles ));
216+ public Map <String , Object > buildAdminProperties () {
217+ Map <String , Object > properties = buildCommonProperties ();
218+ properties .putAll (this .admin .buildProperties ());
247219 return properties ;
248220 }
249221
250222 /**
251223 * Create an initial map of streams properties from the state of this instance.
252224 * <p>
253225 * This allows you to add additional properties, if necessary.
254- * @param sslBundles bundles providing SSL trust material
255226 * @return the streams properties initialized with the customizations defined on this
256227 * instance
257228 */
258- public Map <String , Object > buildStreamsProperties (SslBundles sslBundles ) {
259- Map <String , Object > properties = buildCommonProperties (sslBundles );
260- properties .putAll (this .streams .buildProperties (sslBundles ));
229+ public Map <String , Object > buildStreamsProperties () {
230+ Map <String , Object > properties = buildCommonProperties ();
231+ properties .putAll (this .streams .buildProperties ());
261232 return properties ;
262233 }
263234
@@ -473,7 +444,7 @@ public Map<String, String> getProperties() {
473444 return this .properties ;
474445 }
475446
476- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
447+ public Map <String , Object > buildProperties () {
477448 Properties properties = new Properties ();
478449 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
479450 map .from (this ::getAutoCommitInterval )
@@ -501,7 +472,7 @@ public Map<String, Object> buildProperties(SslBundles sslBundles) {
501472 map .from (this ::getMaxPollInterval )
502473 .asInt (Duration ::toMillis )
503474 .to (properties .in (ConsumerConfig .MAX_POLL_INTERVAL_MS_CONFIG ));
504- return properties .with (this .ssl , this .security , this .properties , sslBundles );
475+ return properties .with (this .ssl , this .security , this .properties );
505476 }
506477
507478 }
@@ -663,7 +634,7 @@ public Map<String, String> getProperties() {
663634 return this .properties ;
664635 }
665636
666- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
637+ public Map <String , Object > buildProperties () {
667638 Properties properties = new Properties ();
668639 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
669640 map .from (this ::getAcks ).to (properties .in (ProducerConfig .ACKS_CONFIG ));
@@ -677,7 +648,7 @@ public Map<String, Object> buildProperties(SslBundles sslBundles) {
677648 map .from (this ::getKeySerializer ).to (properties .in (ProducerConfig .KEY_SERIALIZER_CLASS_CONFIG ));
678649 map .from (this ::getRetries ).to (properties .in (ProducerConfig .RETRIES_CONFIG ));
679650 map .from (this ::getValueSerializer ).to (properties .in (ProducerConfig .VALUE_SERIALIZER_CLASS_CONFIG ));
680- return properties .with (this .ssl , this .security , this .properties , sslBundles );
651+ return properties .with (this .ssl , this .security , this .properties );
681652 }
682653
683654 }
@@ -784,11 +755,11 @@ public Map<String, String> getProperties() {
784755 return this .properties ;
785756 }
786757
787- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
758+ public Map <String , Object > buildProperties () {
788759 Properties properties = new Properties ();
789760 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
790761 map .from (this ::getClientId ).to (properties .in (ProducerConfig .CLIENT_ID_CONFIG ));
791- return properties .with (this .ssl , this .security , this .properties , sslBundles );
762+ return properties .with (this .ssl , this .security , this .properties );
792763 }
793764
794765 }
@@ -918,7 +889,7 @@ public Map<String, String> getProperties() {
918889 return this .properties ;
919890 }
920891
921- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
892+ public Map <String , Object > buildProperties () {
922893 Properties properties = new Properties ();
923894 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
924895 map .from (this ::getApplicationId ).to (properties .in ("application.id" ));
@@ -929,7 +900,7 @@ public Map<String, Object> buildProperties(SslBundles sslBundles) {
929900 map .from (this ::getClientId ).to (properties .in (CommonClientConfigs .CLIENT_ID_CONFIG ));
930901 map .from (this ::getReplicationFactor ).to (properties .in ("replication.factor" ));
931902 map .from (this ::getStateDir ).to (properties .in ("state.dir" ));
932- return properties .with (this .ssl , this .security , this .properties , sslBundles );
903+ return properties .with (this .ssl , this .security , this .properties );
933904 }
934905
935906 }
@@ -1423,12 +1394,7 @@ public void setProtocol(String protocol) {
14231394 this .protocol = protocol ;
14241395 }
14251396
1426- @ Deprecated (since = "3.2.0" , forRemoval = true )
14271397 public Map <String , Object > buildProperties () {
1428- return buildProperties (null );
1429- }
1430-
1431- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
14321398 validate ();
14331399 String bundleName = getBundle ();
14341400 Properties properties = new Properties ();
@@ -1794,8 +1760,8 @@ <V> java.util.function.Consumer<V> in(String key) {
17941760 return (value ) -> put (key , value );
17951761 }
17961762
1797- Properties with (Ssl ssl , Security security , Map <String , String > properties , SslBundles sslBundles ) {
1798- putAll (ssl .buildProperties (sslBundles ));
1763+ Properties with (Ssl ssl , Security security , Map <String , String > properties ) {
1764+ putAll (ssl .buildProperties ());
17991765 putAll (security .buildProperties ());
18001766 putAll (properties );
18011767 return this ;
0 commit comments