Skip to content

Commit a34f48d

Browse files
dharmeshjogadiagaryrussell
authored andcommitted
Remove StreamsConfig dependency
Remove StreamsConfig dependency from StreamsBuilderFactoryBean
1 parent 90e9052 commit a34f48d

File tree

2 files changed

+0
-96
lines changed

2 files changed

+0
-96
lines changed

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

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.apache.kafka.streams.KafkaClientSupplier;
2525
import org.apache.kafka.streams.KafkaStreams;
2626
import org.apache.kafka.streams.StreamsBuilder;
27-
import org.apache.kafka.streams.StreamsConfig;
2827
import org.apache.kafka.streams.Topology;
2928
import org.apache.kafka.streams.processor.StateRestoreListener;
3029
import org.apache.kafka.streams.processor.internals.DefaultKafkaClientSupplier;
@@ -103,32 +102,6 @@ public StreamsBuilderFactoryBean() {
103102
this.cleanupConfig = new CleanupConfig();
104103
}
105104

106-
/**
107-
* Construct an instance with the supplied streams configuration.
108-
* @param streamsConfig the streams configuration.
109-
* @deprecated in favor of {@link #StreamsBuilderFactoryBean(KafkaStreamsConfiguration)}
110-
*/
111-
@Deprecated
112-
public StreamsBuilderFactoryBean(StreamsConfig streamsConfig) {
113-
this(streamsConfig, new CleanupConfig());
114-
}
115-
116-
/**
117-
* Construct an instance with the supplied streams configuration and
118-
* clean up configuration.
119-
* @param streamsConfig the streams configuration.
120-
* @param cleanupConfig the cleanup configuration.
121-
* @since 2.1.2.
122-
* @deprecated in favor of {@link #StreamsBuilderFactoryBean(KafkaStreamsConfiguration, CleanupConfig)}
123-
*/
124-
@Deprecated
125-
public StreamsBuilderFactoryBean(StreamsConfig streamsConfig, CleanupConfig cleanupConfig) {
126-
Assert.notNull(streamsConfig, STREAMS_CONFIG_MUST_NOT_BE_NULL);
127-
Assert.notNull(cleanupConfig, CLEANUP_CONFIG_MUST_NOT_BE_NULL);
128-
this.properties = propertiesFromStreamsConfig(streamsConfig);
129-
this.cleanupConfig = cleanupConfig;
130-
}
131-
132105
/**
133106
* Construct an instance with the supplied streams configuration and
134107
* clean up configuration.
@@ -143,16 +116,6 @@ public StreamsBuilderFactoryBean(KafkaStreamsConfiguration streamsConfig, Cleanu
143116
this.cleanupConfig = cleanupConfig;
144117
}
145118

146-
/**
147-
* Construct an instance with the supplied streams configuration.
148-
* @param streamsConfig the streams configuration.
149-
* @deprecated in favor of {@link #StreamsBuilderFactoryBean(KafkaStreamsConfiguration)}.
150-
*/
151-
@Deprecated
152-
public StreamsBuilderFactoryBean(Map<String, Object> streamsConfig) {
153-
this(streamsConfig, new CleanupConfig());
154-
}
155-
156119
/**
157120
* Construct an instance with the supplied streams configuration.
158121
* @param streamsConfig the streams configuration.
@@ -162,45 +125,6 @@ public StreamsBuilderFactoryBean(KafkaStreamsConfiguration streamsConfig) {
162125
this(streamsConfig, new CleanupConfig());
163126
}
164127

165-
/**
166-
* Construct an instance with the supplied streams configuration and
167-
* clean up configuration.
168-
* @param streamsConfig the streams configuration.
169-
* @param cleanupConfig the cleanup configuration.
170-
* @since 2.1.2.
171-
* @deprecated in favor of {@link #StreamsBuilderFactoryBean(KafkaStreamsConfiguration, CleanupConfig)}.
172-
*/
173-
@Deprecated
174-
public StreamsBuilderFactoryBean(Map<String, Object> streamsConfig, CleanupConfig cleanupConfig) {
175-
Assert.notNull(streamsConfig, STREAMS_CONFIG_MUST_NOT_BE_NULL);
176-
Assert.notNull(cleanupConfig, CLEANUP_CONFIG_MUST_NOT_BE_NULL);
177-
this.properties = propertiesFromConfigs(streamsConfig);
178-
this.cleanupConfig = cleanupConfig;
179-
}
180-
181-
/**
182-
* Set {@link StreamsConfig} on this factory.
183-
* @param streamsConfig the streams configuration.
184-
* @deprecated in favor of {@link #setStreamsConfiguration(Properties)}.
185-
* @since 2.1.3
186-
*/
187-
@Deprecated
188-
public void setStreamsConfig(StreamsConfig streamsConfig) {
189-
Assert.notNull(streamsConfig, STREAMS_CONFIG_MUST_NOT_BE_NULL);
190-
Assert.isNull(this.properties, "Cannot have both streamsConfig and streams configuration properties");
191-
this.properties = propertiesFromStreamsConfig(streamsConfig);
192-
}
193-
194-
/**
195-
* Get the streams config.
196-
* @return the config.
197-
* @deprecated in favor of {@link #getStreamsConfiguration()}.
198-
*/
199-
@Deprecated
200-
public StreamsConfig getStreamsConfig() {
201-
return new StreamsConfig(this.properties);
202-
}
203-
204128
/**
205129
* Set {@link StreamsConfig} on this factory.
206130
* @param streamsConfig the streams configuration.
@@ -357,10 +281,6 @@ public synchronized boolean isRunning() {
357281
return this.running;
358282
}
359283

360-
private Properties propertiesFromStreamsConfig(StreamsConfig config) {
361-
return propertiesFromConfigs(config.originals());
362-
}
363-
364284
private Properties propertiesFromConfigs(Map<String, Object> configs) {
365285
Properties props = new Properties();
366286
props.putAll(configs);

spring-kafka/src/test/java/org/springframework/kafka/config/StreamsBuilderFactoryBeanTests.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,6 @@ protected StreamsBuilder createInstance() {
101101
verify(streamsBuilder).build(kafkaStreamsConfiguration.asProperties());
102102
}
103103

104-
@Test
105-
@SuppressWarnings("deprecation")
106-
public void testBuildWithStreamsConfig() throws Exception {
107-
StreamsConfig streamsConfig = new StreamsConfig(kafkaStreamsConfiguration.asProperties());
108-
streamsBuilderFactoryBean = new StreamsBuilderFactoryBean(streamsConfig) {
109-
@Override
110-
protected StreamsBuilder createInstance() {
111-
return spy(super.createInstance());
112-
}
113-
};
114-
streamsBuilderFactoryBean.afterPropertiesSet();
115-
streamsBuilderFactoryBean.start();
116-
StreamsBuilder streamsBuilder = streamsBuilderFactoryBean.getObject();
117-
verify(streamsBuilder).build(kafkaStreamsConfiguration.asProperties());
118-
}
119-
120104
@Configuration
121105
@EnableKafkaStreams
122106
public static class KafkaStreamsConfig {

0 commit comments

Comments
 (0)