Class ShareConsumerStoppingEvent

All Implemented Interfaces:
Serializable

public class ShareConsumerStoppingEvent extends KafkaEvent
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:
  • Constructor Details

    • ShareConsumerStoppingEvent

      public ShareConsumerStoppingEvent(Object source, Object container, org.apache.kafka.clients.consumer.ShareConsumer<?,?> consumer)
      Construct an instance with the provided source, container, and share consumer.
      Parameters:
      source - the container instance that generated the event.
      container - the container or the parent container if the container is a child.
      consumer - the share consumer.
  • Method Details

    • getConsumer

      public org.apache.kafka.clients.consumer.ShareConsumer<?,?> getConsumer()
      Return the share consumer.
      Returns:
      the share consumer.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject