A part of the code in this repository shows a workaround or solution in response to a question raised:
@ConditionalOnProperty how to use twice on the same bean? https://stackoverflow.com/questions/79547223/conditionalonproperty-how-to-use-twice-on-the-same-bean