sandjelkovic
06/05/2020, 1:19 PMComponent
, and hook into destroy events or create destroy handlers to close.
Another is to use a CommandLineRunner
instead of a Component. This also has the benefit of being invoked after the context is initialized. Here’s an example for a Reactive Kafka consumer and can used this way.