Package org.springframework.kafka.event
Class ShareConsumerStoppingEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.kafka.event.KafkaEvent
org.springframework.kafka.event.ShareConsumerStoppingEvent
- All Implemented Interfaces:
Serializable
An event published when a share consumer is stopping. While it is best practice to use
stateless listeners, you can consume this event to clean up any thread-based resources
(remove ThreadLocals, destroy thread-scoped beans etc), as long as the context event
multicaster is not modified to use an async task executor.
- Since:
- 4.1
- Author:
- Youngjoo Kim
- See Also:
-
ShareConsumer- Serialized Form
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionShareConsumerStoppingEvent(Object source, Object container, org.apache.kafka.clients.consumer.ShareConsumer<?, ?> consumer) Construct an instance with the provided source, container, and share consumer. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.kafka.clients.consumer.ShareConsumer<?,?> Return the share consumer.toString()Methods inherited from class org.springframework.kafka.event.KafkaEvent
getContainer, getSourceMethods inherited from class org.springframework.context.ApplicationEvent
getTimestampMethods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
Method Details
-
getConsumer
public org.apache.kafka.clients.consumer.ShareConsumer<?,?> getConsumer()Return the share consumer.- Returns:
- the share consumer.
-
toString
- Overrides:
toStringin classEventObject
-