9090 * @author Elliot Kennedy
9191 * @author Nakul Mishra
9292 * @author Pawel Lozinski
93+ * @author Adrian Chlebosz
9394 *
9495 * @since 2.2
9596 */
@@ -113,7 +114,7 @@ public class EmbeddedKafkaBroker implements InitializingBean, DisposableBean {
113114 */
114115 public static final String BROKER_LIST_PROPERTY = "spring.embedded.kafka.brokers.property" ;
115116
116- private static final Duration DEFAULT_ADMIN_TIMEOUT = Duration . ofSeconds ( 10 ) ;
117+ public static final int DEFAULT_ADMIN_TIMEOUT = 10 ;
117118
118119 public static final int DEFAULT_ZK_SESSION_TIMEOUT = 18000 ;
119120
@@ -157,7 +158,7 @@ public class EmbeddedKafkaBroker implements InitializingBean, DisposableBean {
157158
158159 private int [] kafkaPorts ;
159160
160- private Duration adminTimeout = DEFAULT_ADMIN_TIMEOUT ;
161+ private Duration adminTimeout = Duration . ofSeconds ( DEFAULT_ADMIN_TIMEOUT ) ;
161162
162163 private int zkConnectionTimeout = DEFAULT_ZK_CONNECTION_TIMEOUT ;
163164
@@ -238,33 +239,24 @@ public EmbeddedKafkaBroker kafkaPorts(int... ports) {
238239 }
239240
240241 /**
241- * Set an explicit port for the embedded Zookeeper .
242- * @param port the port.
243- * @return the {@link EmbeddedKafkaBroker} .
242+ * Set the system property with this name to the list of broker addresses .
243+ * @param brokerListProperty the brokerListProperty to set
244+ * @return this broker .
244245 * @since 2.3
245246 */
246- public EmbeddedKafkaBroker zkPort ( int port ) {
247- this .zkPort = port ;
247+ public EmbeddedKafkaBroker brokerListProperty ( String brokerListProperty ) {
248+ this .brokerListProperty = brokerListProperty ;
248249 return this ;
249250 }
250- /**
251- * Set the timeout in seconds for admin operations (e.g. topic creation, close).
252- * Default 30 seconds.
253- * @param adminTimeout the timeout.
254- * @since 2.2
255- */
256- public void setAdminTimeout (int adminTimeout ) {
257- this .adminTimeout = Duration .ofSeconds (adminTimeout );
258- }
259251
260252 /**
261- * Set the system property with this name to the list of broker addresses .
262- * @param brokerListProperty the brokerListProperty to set
263- * @return this broker .
253+ * Set an explicit port for the embedded Zookeeper .
254+ * @param port the port.
255+ * @return the {@link EmbeddedKafkaBroker} .
264256 * @since 2.3
265257 */
266- public EmbeddedKafkaBroker brokerListProperty ( String brokerListProperty ) {
267- this .brokerListProperty = brokerListProperty ;
258+ public EmbeddedKafkaBroker zkPort ( int port ) {
259+ this .zkPort = port ;
268260 return this ;
269261 }
270262
@@ -286,6 +278,27 @@ public void setZkPort(int zkPort) {
286278 this .zkPort = zkPort ;
287279 }
288280
281+ /**
282+ * Set the timeout in seconds for admin operations (e.g. topic creation, close).
283+ * @param adminTimeout the timeout.
284+ * @return the {@link EmbeddedKafkaBroker}
285+ * @since 2.8.5
286+ */
287+ public EmbeddedKafkaBroker adminTimeout (int adminTimeout ) {
288+ this .adminTimeout = Duration .ofSeconds (adminTimeout );
289+ return this ;
290+ }
291+
292+ /**
293+ * Set the timeout in seconds for admin operations (e.g. topic creation, close).
294+ * Default 10 seconds.
295+ * @param adminTimeout the timeout.
296+ * @since 2.2
297+ */
298+ public void setAdminTimeout (int adminTimeout ) {
299+ this .adminTimeout = Duration .ofSeconds (adminTimeout );
300+ }
301+
289302 /**
290303 * Set connection timeout for the client to the embedded Zookeeper.
291304 * @param zkConnectionTimeout the connection timeout,
0 commit comments