'Spring cloud stream bindings - channel name from another property

I'm struggling to pass the channel name to spring.cloud.stream.bindings from another property.

Take a look at an example, this works:

channel-name=orderPaid-out-0
spring.cloud.stream.bindings.${channel-name}.destination=topic.order.paid

But this doesn't work, why?

messaging.channel-name=orderPaid-out-0
spring.cloud.stream.bindings.${messaging.channel-name}.destination=topic.order.paid


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source