Using Spring’s Kotlin BeanDefinitonDsl, e.g. ```fu...
# spring
c
Using Spring’s Kotlin BeanDefinitonDsl, e.g.
Copy code
fun beans() = beans {
    bean<PropertySourceLoggingEventListener>()
}
Not able to find an equivalent to
@Order
for ordering beans, e.g.
Copy code
@Bean
@Order(33)
fun someBean() = "abc"
Ideas on how provide equivalent ordering of beans?
k
did you try implement
Ordered
interface?
c
Goal is to specify order at bean definition time without changing implementation, as with ‘@Order’
k
curious, what is the use case?
and btw does that even work?
Copy code
@Bean
@Order(33)
c
It works, it’s the recommended pattern when using configuration classes. Several use cases relating to injecting lists of beans of the same type, where the order matters.
Some of the types come from libraries and can’t otherwise use Ordered interface.
Opened a ticket for this.
👍 1