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,8 +186,8 @@ private Map<String, Object> buildCommonProperties(SslBundles sslBundles) {
187186 * instance
188187 */
189188 public Map <String , Object > buildConsumerProperties () {
190- Map <String , Object > properties = buildCommonProperties (null );
191- properties .putAll (this .consumer .buildProperties (null ));
189+ Map <String , Object > properties = buildCommonProperties ();
190+ properties .putAll (this .consumer .buildProperties ());
192191 return properties ;
193192 }
194193
@@ -201,21 +200,8 @@ public Map<String, Object> buildConsumerProperties() {
201200 * instance
202201 */
203202 public Map <String , Object > buildProducerProperties () {
204- return buildProducerProperties (null );
205- }
206-
207- /**
208- * Create an initial map of producer properties from the state of this instance.
209- * <p>
210- * This allows you to add additional properties, if necessary, and override the
211- * default {@code kafkaProducerFactory} bean.
212- * @param sslBundles bundles providing SSL trust material
213- * @return the producer properties initialized with the customizations defined on this
214- * instance
215- */
216- public Map <String , Object > buildProducerProperties (SslBundles sslBundles ) {
217- Map <String , Object > properties = buildCommonProperties (sslBundles );
218- properties .putAll (this .producer .buildProperties (sslBundles ));
203+ Map <String , Object > properties = buildCommonProperties ();
204+ properties .putAll (this .producer .buildProperties ());
219205 return properties ;
220206 }
221207
@@ -224,27 +210,25 @@ public Map<String, Object> buildProducerProperties(SslBundles sslBundles) {
224210 * <p>
225211 * This allows you to add additional properties, if necessary, and override the
226212 * default {@code kafkaAdmin} bean.
227- * @param sslBundles bundles providing SSL trust material
228213 * @return the admin properties initialized with the customizations defined on this
229214 * instance
230215 */
231- public Map <String , Object > buildAdminProperties (SslBundles sslBundles ) {
232- Map <String , Object > properties = buildCommonProperties (sslBundles );
233- properties .putAll (this .admin .buildProperties (sslBundles ));
216+ public Map <String , Object > buildAdminProperties () {
217+ Map <String , Object > properties = buildCommonProperties ();
218+ properties .putAll (this .admin .buildProperties ());
234219 return properties ;
235220 }
236221
237222 /**
238223 * Create an initial map of streams properties from the state of this instance.
239224 * <p>
240225 * This allows you to add additional properties, if necessary.
241- * @param sslBundles bundles providing SSL trust material
242226 * @return the streams properties initialized with the customizations defined on this
243227 * instance
244228 */
245- public Map <String , Object > buildStreamsProperties (SslBundles sslBundles ) {
246- Map <String , Object > properties = buildCommonProperties (sslBundles );
247- properties .putAll (this .streams .buildProperties (sslBundles ));
229+ public Map <String , Object > buildStreamsProperties () {
230+ Map <String , Object > properties = buildCommonProperties ();
231+ properties .putAll (this .streams .buildProperties ());
248232 return properties ;
249233 }
250234
@@ -460,7 +444,7 @@ public Map<String, String> getProperties() {
460444 return this .properties ;
461445 }
462446
463- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
447+ public Map <String , Object > buildProperties () {
464448 Properties properties = new Properties ();
465449 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
466450 map .from (this ::getAutoCommitInterval )
@@ -488,7 +472,7 @@ public Map<String, Object> buildProperties(SslBundles sslBundles) {
488472 map .from (this ::getMaxPollInterval )
489473 .asInt (Duration ::toMillis )
490474 .to (properties .in (ConsumerConfig .MAX_POLL_INTERVAL_MS_CONFIG ));
491- return properties .with (this .ssl , this .security , this .properties , sslBundles );
475+ return properties .with (this .ssl , this .security , this .properties );
492476 }
493477
494478 }
@@ -650,7 +634,7 @@ public Map<String, String> getProperties() {
650634 return this .properties ;
651635 }
652636
653- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
637+ public Map <String , Object > buildProperties () {
654638 Properties properties = new Properties ();
655639 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
656640 map .from (this ::getAcks ).to (properties .in (ProducerConfig .ACKS_CONFIG ));
@@ -664,7 +648,7 @@ public Map<String, Object> buildProperties(SslBundles sslBundles) {
664648 map .from (this ::getKeySerializer ).to (properties .in (ProducerConfig .KEY_SERIALIZER_CLASS_CONFIG ));
665649 map .from (this ::getRetries ).to (properties .in (ProducerConfig .RETRIES_CONFIG ));
666650 map .from (this ::getValueSerializer ).to (properties .in (ProducerConfig .VALUE_SERIALIZER_CLASS_CONFIG ));
667- return properties .with (this .ssl , this .security , this .properties , sslBundles );
651+ return properties .with (this .ssl , this .security , this .properties );
668652 }
669653
670654 }
@@ -771,11 +755,11 @@ public Map<String, String> getProperties() {
771755 return this .properties ;
772756 }
773757
774- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
758+ public Map <String , Object > buildProperties () {
775759 Properties properties = new Properties ();
776760 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
777761 map .from (this ::getClientId ).to (properties .in (ProducerConfig .CLIENT_ID_CONFIG ));
778- return properties .with (this .ssl , this .security , this .properties , sslBundles );
762+ return properties .with (this .ssl , this .security , this .properties );
779763 }
780764
781765 }
@@ -905,7 +889,7 @@ public Map<String, String> getProperties() {
905889 return this .properties ;
906890 }
907891
908- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
892+ public Map <String , Object > buildProperties () {
909893 Properties properties = new Properties ();
910894 PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
911895 map .from (this ::getApplicationId ).to (properties .in ("application.id" ));
@@ -916,7 +900,7 @@ public Map<String, Object> buildProperties(SslBundles sslBundles) {
916900 map .from (this ::getClientId ).to (properties .in (CommonClientConfigs .CLIENT_ID_CONFIG ));
917901 map .from (this ::getReplicationFactor ).to (properties .in ("replication.factor" ));
918902 map .from (this ::getStateDir ).to (properties .in ("state.dir" ));
919- return properties .with (this .ssl , this .security , this .properties , sslBundles );
903+ return properties .with (this .ssl , this .security , this .properties );
920904 }
921905
922906 }
@@ -1410,12 +1394,7 @@ public void setProtocol(String protocol) {
14101394 this .protocol = protocol ;
14111395 }
14121396
1413- @ Deprecated (since = "3.2.0" , forRemoval = true )
14141397 public Map <String , Object > buildProperties () {
1415- return buildProperties (null );
1416- }
1417-
1418- public Map <String , Object > buildProperties (SslBundles sslBundles ) {
14191398 validate ();
14201399 String bundleName = getBundle ();
14211400 Properties properties = new Properties ();
@@ -1781,8 +1760,8 @@ <V> java.util.function.Consumer<V> in(String key) {
17811760 return (value ) -> put (key , value );
17821761 }
17831762
1784- Properties with (Ssl ssl , Security security , Map <String , String > properties , SslBundles sslBundles ) {
1785- putAll (ssl .buildProperties (sslBundles ));
1763+ Properties with (Ssl ssl , Security security , Map <String , String > properties ) {
1764+ putAll (ssl .buildProperties ());
17861765 putAll (security .buildProperties ());
17871766 putAll (properties );
17881767 return this ;
0 commit comments