Refactor ListenerConfig and ListenerRole into Listener class with constants#227
Refactor ListenerConfig and ListenerRole into Listener class with constants#227guancioul wants to merge 3 commits into
Conversation
9d7f39e to
dacf587
Compare
see-quick
left a comment
There was a problem hiding this comment.
Thanks for this change @guancioul, please also update all test suites which uses exact strings of the listeners and change it to Listener.PLAINTEXT ... (i.e.,StrimziKafkaContainerMockTest, StrimziKafkaClusterTest, StrimziKafkaContainerIT).
|
Thanks for the review. I have updated some missing references in those test suites in fb2948d. One thing I'd like to check — there are also usages where the listener name is embedded in a full URL string, for example: Should these also be updated to use the constants (e.g. |
While I partially agree, I believe it would be better to define listener names from a single source of truth. This would help avoid making the same change in multiple places. If the listener name needs to be updated in the future, it could be done in one location, and all related tests would be updated automatically through refactoring. |
|
Agree, I change the code to let listener names become a single source of truth. I also added |
|
Would you mind rebasing after this change #227? |
…stener name constants Signed-off-by: guancioul <guancioul@gmail.com>
Signed-off-by: guancioul <guancioul@gmail.com>
Signed-off-by: guancioul <guancioul@gmail.com>
00ecdf0 to
68cc255
Compare
|
Sure, I have rebased this branch! |
Thanks, I will have a look once I find some time. |
|
Please take a look on this @strimzi/maintainers . |
Close #212,
Summary
ListenerConfiginner class andListenerRoleenum fromStrimziKafkaContainerinto a new top-levelListenerclass (Listener.java), reducing the coupling between listener configuration and the container classPLAINTEXT,CONTROLLER,CONTROLLER_EXTERNAL,INTER_BROKER_PREFIX) inListenerto eliminate magic strings scattered acrossStrimziKafkaContainerStrimziKafkaContainerandStrimziKafkaContainerTestto use the newListenerclass and its constants