Skip to content

Commit 48b3780

Browse files
zacholausonartembilan
authored andcommitted
GH-618: Add StreamsBuilderFBean#getStreamsConfig
Resolves #618 While the `StreamsBuilderFactoryBean` requires a `StreamsConfig` to function, it has the ability to add a `StreamsConfig` after creation, so it's technically possible that it could return `null`. * Fix typo in `StreamsBuilderFactoryLateConfigTests`
1 parent 62594ae commit 48b3780

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

spring-kafka/src/main/java/org/springframework/kafka/core/StreamsBuilderFactoryBean.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.springframework.beans.factory.config.AbstractFactoryBean;
2929
import org.springframework.context.SmartLifecycle;
3030
import org.springframework.kafka.KafkaException;
31+
import org.springframework.lang.Nullable;
3132
import org.springframework.util.Assert;
3233

3334
/**
@@ -37,6 +38,7 @@
3738
* @author Artem Bilan
3839
* @author Ivan Ursul
3940
* @author Soby Chacko
41+
* @author Zach Olauson
4042
*
4143
* @since 1.1.4
4244
*/
@@ -128,6 +130,11 @@ public void setStreamsConfig(StreamsConfig streamsConfig) {
128130
this.streamsConfig = streamsConfig;
129131
}
130132

133+
@Nullable
134+
public StreamsConfig getStreamsConfig() {
135+
return this.streamsConfig;
136+
}
137+
131138
public void setClientSupplier(KafkaClientSupplier clientSupplier) {
132139
Assert.notNull(clientSupplier, "'clientSupplier' must not be null");
133140
this.clientSupplier = clientSupplier; // NOSONAR (sync)

spring-kafka/src/test/java/org/springframework/kafka/core/StreamsBuilderFactoryLateConfigTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class StreamsBuilderFactoryLateConfigTests {
5555
private StreamsBuilderFactoryBean streamsBuilderFactoryBean;
5656

5757
@Test(expected = KafkaException.class)
58-
public void testStreamBuilderFactoryCannotBeStartedWithoutStreamconfig() {
58+
public void testStreamBuilderFactoryCannotBeStartedWithoutStreamsConfig() {
5959
StreamsBuilderFactoryBean streamsBuilderFactoryBean = new StreamsBuilderFactoryBean();
6060
streamsBuilderFactoryBean.start();
6161
}

0 commit comments

Comments
 (0)