blog2019
blog2019 copied to clipboard
Could not autowire. There is more than one bean of 'HazelcastInstance' type.
trafficstars
IntelliJ IDEA tips Application#L23-L24 Could not autowire. There is more than one bean of 'HazelcastInstance' type. Beans: hazelcastInstance (HazelcastServerConfiguration.class) hazelcastInstance (HazelcastClientConfiguration.class)
Can't reproduce.
This is what I did
git clone https://github.com/ralscha/blog2019.git
cd blog2019/ratelimit
./mvnw spring-boot:run
Yes, it does not affect service startup, it is just a canonical check for Jetbrains on Spring Bean assembly.
I use getOrCreateHazelcastInstance avoid this problem, perhaps it was hazelcast-spring's faults Or maybe it doesn't matter.
@Bean
HazelcastInstance clusterHazelcastInstance( ) {
Config config = new Config( );
config.setInstanceName( "cluster.local.hz" );
config.getCPSubsystemConfig( ).setCPMemberCount( 3 );
return Hazelcast.getOrCreateHazelcastInstance( config );
}
I see. Thanks for the feedback.