I have a usecase where I need to start listeners programmatically based on some configuration at runtime.
I was wondering how to register pulsar listeners at runtime without using the static @PulsarListener
annotation.
thank you
The way it currently works is as follows:
The PulsarListenerAnnotationBeanPostProcessor
scans all @PulsarListener
and for each one it...
PulsarListenerEndpointRegistrar
to register the endpoint to a container factoryPulsarListenerEndpointRegistry
to register the endpoint and container factoryThis is a more uncommon usecase and as such there is no built-in support for registering containers w/ the registry dynamically after app start.
However, you can create your own container instances and handle the lifecycle methods yourself by manually starting/stopping them (e.g. here).
I will provide a prototype that details several variants of the above in the next 24-48hrs but wanted to get you the above preliminary information quickly.