|
|
|
@ -16,7 +16,6 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.cloud.alibaba.nacos;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
@ -27,6 +26,7 @@ import org.springframework.cloud.alibaba.nacos.registry.NacosRegistration;
|
|
|
|
|
import org.springframework.cloud.alibaba.nacos.registry.NacosServiceRegistry;
|
|
|
|
|
import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration;
|
|
|
|
|
import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationProperties;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
|
|
|
@ -50,8 +50,10 @@ public class NacosDiscoveryAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnBean(AutoServiceRegistrationProperties.class)
|
|
|
|
|
public NacosRegistration nacosRegistration() {
|
|
|
|
|
return new NacosRegistration();
|
|
|
|
|
public NacosRegistration nacosRegistration(
|
|
|
|
|
NacosDiscoveryProperties nacosDiscoveryProperties,
|
|
|
|
|
ApplicationContext context) {
|
|
|
|
|
return new NacosRegistration(nacosDiscoveryProperties, context);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|