Class StreamsBuilderFactoryManager
java.lang.Object
org.springframework.cloud.stream.binder.kafka.streams.StreamsBuilderFactoryManager
- All Implemented Interfaces:
org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class StreamsBuilderFactoryManager
extends Object
implements org.springframework.context.SmartLifecycle
Iterate through all
StreamsBuilderFactoryBean in the application context and
start them. As each one completes starting, register the associated KafkaStreams object
into InteractiveQueryService.
This SmartLifecycle class ensures that the bean created from it is started very
late through the bootstrap process by setting the phase value closer to
Integer.MAX_VALUE. This is to guarantee that the StreamsBuilderFactoryBean on a
StreamListener method with multiple
bindings is only started after all the binding phases have completed successfully.- Author:
- Soby Chacko
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Method Summary
-
Method Details
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-