Class ContainerGroup
java.lang.Object
org.springframework.kafka.listener.ContainerGroup
- All Implemented Interfaces:
Lifecycle
A group of listener containers.
- Since:
- 2.7.3
- Author:
- Gary Russell
-
Constructor Summary
ConstructorDescriptionContainerGroup
(String name) Construct an instance with the provided name.ContainerGroup
(String name, List<MessageListenerContainer> containers) Construct an instance with the provided name and containers.ContainerGroup
(String name, MessageListenerContainer... containers) Construct an instance with the provided name and containers. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContainers
(MessageListenerContainer... theContainers) Add one or more containers to the group.boolean
Return true if all containers in this group are stopped.boolean
contains
(MessageListenerContainer container) Return true if the provided container is in this group.Return the listener ids of the containers in this group.getName()
Return the group name.boolean
boolean
removeContainer
(MessageListenerContainer container) Remove a container from the group.void
start()
void
stop()
toString()
-
Constructor Details
-
ContainerGroup
Construct an instance with the provided name.- Parameters:
name
- the group name.
-
ContainerGroup
Construct an instance with the provided name and containers.- Parameters:
name
- the group name.containers
- the containers.
-
ContainerGroup
Construct an instance with the provided name and containers.- Parameters:
name
- the group name.containers
- the containers.
-
-
Method Details
-
getName
Return the group name.- Returns:
- the name.
-
getListenerIds
Return the listener ids of the containers in this group.- Returns:
- the listener ids.
-
contains
Return true if the provided container is in this group.- Parameters:
container
- the container.- Returns:
- true if it is in this group.
-
allStopped
public boolean allStopped()Return true if all containers in this group are stopped.- Returns:
- true if all are stopped.
-
addContainers
Add one or more containers to the group.- Parameters:
theContainers
- the container(s).
-
removeContainer
Remove a container from the group.- Parameters:
container
- the container.- Returns:
- true if the container was removed.
-
start
public void start() -
stop
public void stop() -
isRunning
public boolean isRunning() -
toString
-