if there two ConfigurationClass, A import B, A have ConditionalOn B's Bean, I guess should load B first then load A, so that way A will create the right Bean with B's Bean
Comment From: bclozel
I don't understand. Could you elaborate with a concrete example or better, a sample that shows a behavior that you think is wrong?
Comment From: adgar-shi
it is like when i use @Import i don't need using @AutoConfigureAfter
Brian Clozel @.***> 于2022年12月1日周四 01:38写道:
I don't understand. Could you elaborate with a concrete example or better, a sample that shows a behavior that you think is wrong?
— Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-boot/issues/33425#issuecomment-1332516397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMKOX7T4PPEPTIINJ6KSU7TWK6GHVANCNFSM6AAAAAASP242JA . You are receiving this because you authored the thread.Message ID: @.***>
Comment From: bclozel
I still don't get it sorry.
Comment From: adgar-shi
like this, I already using @Import and than still need using @AutoConfigureAfter let RedisConnectionConfiguration load first ...
@AutoConfigureAfter(RedisConnectionConfiguration.class)
@Import(RedisConnectionConfiguration.class)
public class RedisConfiguration {
@ConditionalOnBean(name = "sentalConnection")
public Sental sental(SentalConnection sentalConnection) {
return new Sental(sentalConnection);
}
@ConditionalOnBean(name = "clusterConnection")
public Cluster cluster(ClusterConnection clusterConnection) {
return new Cluster(clusterConnection);
}
}
public class RedisConnectionConfiguration {
@Bean
public ClusterConnection clusterConnection() {
return new ClusterConnection();
}
}
Comment From: philwebb
@AutoConfigureAfter is only used to sort auto-configuration classes, it doesn't have any effect on regular configuration classes. With your example above, if RedisConnectionConfiguration is an auto-configuration class then it should not be used with @Import. If it's a regular configuration class then it shouldn't be in @AutoConfigureAfter.