public class StreamsBuilderFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<org.apache.kafka.streams.StreamsBuilder>
implements org.springframework.context.SmartLifecycle
AbstractFactoryBean
for the StreamsBuilder
instance
and lifecycle control for the internal KafkaStreams
instance.Constructor and Description |
---|
StreamsBuilderFactoryBean(java.util.Map<java.lang.String,java.lang.Object> streamsConfig)
Construct an instance with the supplied streams configuration.
|
StreamsBuilderFactoryBean(java.util.Map<java.lang.String,java.lang.Object> streamsConfig,
CleanupConfig cleanupConfig)
Construct an instance with the supplied streams configuration and
clean up configuration.
|
StreamsBuilderFactoryBean(org.apache.kafka.streams.StreamsConfig streamsConfig)
Construct an instance with the supplied streams configuration.
|
StreamsBuilderFactoryBean(org.apache.kafka.streams.StreamsConfig streamsConfig,
CleanupConfig cleanupConfig)
Construct an instance with the supplied streams configuration and
clean up configuration.
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.kafka.streams.StreamsBuilder |
createInstance() |
org.apache.kafka.streams.KafkaStreams |
getKafkaStreams()
Get a managed by this
StreamsBuilderFactoryBean KafkaStreams instance. |
java.lang.Class<?> |
getObjectType() |
int |
getPhase() |
boolean |
isAutoStartup() |
boolean |
isRunning() |
void |
setAutoStartup(boolean autoStartup) |
void |
setClientSupplier(org.apache.kafka.streams.KafkaClientSupplier clientSupplier) |
void |
setCloseTimeout(int closeTimeout)
Specify the timeout in seconds for the
KafkaStreams.close(long, TimeUnit) operation. |
void |
setPhase(int phase) |
void |
setStateListener(org.apache.kafka.streams.KafkaStreams.StateListener stateListener) |
void |
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler exceptionHandler) |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
public StreamsBuilderFactoryBean(org.apache.kafka.streams.StreamsConfig streamsConfig)
streamsConfig
- the streams configuration.public StreamsBuilderFactoryBean(org.apache.kafka.streams.StreamsConfig streamsConfig, CleanupConfig cleanupConfig)
streamsConfig
- the streams configuration.cleanupConfig
- the cleanup configuration.public StreamsBuilderFactoryBean(java.util.Map<java.lang.String,java.lang.Object> streamsConfig)
streamsConfig
- the streams configuration.public StreamsBuilderFactoryBean(java.util.Map<java.lang.String,java.lang.Object> streamsConfig, CleanupConfig cleanupConfig)
streamsConfig
- the streams configuration.cleanupConfig
- the cleanup configuration.public void setClientSupplier(org.apache.kafka.streams.KafkaClientSupplier clientSupplier)
public void setStateListener(org.apache.kafka.streams.KafkaStreams.StateListener stateListener)
public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler exceptionHandler)
public void setCloseTimeout(int closeTimeout)
KafkaStreams.close(long, TimeUnit)
operation.
Defaults to seconds.closeTimeout
- the timeout for close in seconds.KafkaStreams.close(long, TimeUnit)
public java.lang.Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<org.apache.kafka.streams.StreamsBuilder>
getObjectType
in class org.springframework.beans.factory.config.AbstractFactoryBean<org.apache.kafka.streams.StreamsBuilder>
protected org.apache.kafka.streams.StreamsBuilder createInstance() throws java.lang.Exception
createInstance
in class org.springframework.beans.factory.config.AbstractFactoryBean<org.apache.kafka.streams.StreamsBuilder>
java.lang.Exception
public void setAutoStartup(boolean autoStartup)
public void setPhase(int phase)
public boolean isAutoStartup()
isAutoStartup
in interface org.springframework.context.SmartLifecycle
public void stop(java.lang.Runnable callback)
stop
in interface org.springframework.context.SmartLifecycle
public void start()
start
in interface org.springframework.context.Lifecycle
public void stop()
stop
in interface org.springframework.context.Lifecycle
public boolean isRunning()
isRunning
in interface org.springframework.context.Lifecycle
public int getPhase()
getPhase
in interface org.springframework.context.Phased
public org.apache.kafka.streams.KafkaStreams getKafkaStreams()
StreamsBuilderFactoryBean
KafkaStreams
instance.StreamsBuilderFactoryBean
hasn't been started.