You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/receiving-messages/kafkalistener-lifecycle.adoc
+46Lines changed: 46 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,3 +41,49 @@ IMPORTANT: Endpoints registered after the application context has been refreshed
41
41
An example of late registration is a bean with a `@KafkaListener` in prototype scope where an instance is created after the context is initialized.
42
42
Starting with version 2.8.7, you can set the registry's `alwaysStartAfterRefresh` property to `false` and then the container's `autoStartup` property will define whether or not the container is started.
43
43
44
+
[[retrieving-message-listener-containers]]
45
+
46
+
== Retrieving MessageListenerContainers from KafkaListenerEndpointRegistry
47
+
48
+
The `KafkaListenerEndpointRegistry` provides methods for retrieving `MessageListenerContainer` instances to accommodate a range of management scenarios:
49
+
50
+
**All Containers**: For operations that cover all listener containers, use `getListenerContainers()` to retrieve a comprehensive collection.
**Dynamic Container Filtering**: Introduced in version 3.2, two overloaded `getListenerContainersMatching` methods enable refined selection of containers.
65
+
One method takes a `Predicate<String>` for ID-based filtering as a parameter, while the other takes a `BiPredicate<String, MessageListenerContainer>`
66
+
for more advanced criteria that may include container properties or state as a parameter.
Copy file name to clipboardExpand all lines: spring-kafka-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -87,3 +87,12 @@ See xref:kafka/seek.adoc#seek[Seek API Docs] for more details.
87
87
For Spring Boot applications which define an application name, this name is now used
88
88
as a default prefix for auto-generated client IDs for certain client types.
89
89
See xref:kafka/connecting.adoc#default-client-id-prefixes[Default client ID prefixes] for more details.
90
+
91
+
[[get-listener-containers-matching]]
92
+
== Enhanced Retrieval of MessageListenerContainers
93
+
94
+
`ListenerContainerRegistry` provides two new API's dynamically find and filter `MessageListenerContainer` instances.
95
+
`getListenerContainersMatching(Predicate<String> idMatcher)` to filter by ID and the other is
96
+
`getListenerContainersMatching(BiPredicate<String, MessageListenerContainer> matcher)` to filter by ID and container properties.
97
+
98
+
See xref:kafka/receiving-messages/kafkalistener-lifecycle.adoc#retrieving-message-listener-containers[`@KafkaListener` Lifecycle Management's API Docs] for more information.
0 commit comments