KafkaListenerEndpointRegistry - destroying messageListenerContainers does not unregister them #2374
-
Being able to register listeners at runtime via the kafkaListenerEndpointRegistry is great. However when calling stop() and destroy() on MessageListenerContainer - this does not remove the bean from the kafkaListenerEndpointRegistry listenerContainers. I cannot register, destroy - then re-register a container listener with the same ID without restarting the JVM. I receive an error 'Another endpoint is already registered with id' when calling kafkaListenerEndpointRegistry.registerListenerContainer. Should I just not use the KafkaListenerEndpointRegistry if I want to dynamically register and unregister listeners at runtime? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This has come up before; I have no fundamental objection to adding a remove method, but practically, you could just use your own registry. On the other hand, the registry does perform some manipulation on the endpoints so you might have to duplicate that code. I'll create an issue from this. |
Beta Was this translation helpful? Give feedback.
This has come up before; I have no fundamental objection to adding a remove method, but practically, you could just use your own registry. On the other hand, the registry does perform some manipulation on the endpoints so you might have to duplicate that code.
I'll create an issue from this.