|
|
@ -59,8 +59,8 @@ import com.alibaba.cloud.dubbo.service.DubboGenericServiceFactory;
|
|
|
|
@ConditionalOnClass(name = { "org.springframework.web.client.RestTemplate" })
|
|
|
|
@ConditionalOnClass(name = { "org.springframework.web.client.RestTemplate" })
|
|
|
|
@AutoConfigureAfter(name = {
|
|
|
|
@AutoConfigureAfter(name = {
|
|
|
|
"org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration" })
|
|
|
|
"org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration" })
|
|
|
|
public class DubboLoadBalancedRestTemplateAutoConfiguration
|
|
|
|
public class DubboLoadBalancedRestTemplateAutoConfiguration implements
|
|
|
|
implements BeanClassLoaderAware, ApplicationContextAware, SmartInitializingSingleton {
|
|
|
|
BeanClassLoaderAware, ApplicationContextAware, SmartInitializingSingleton {
|
|
|
|
|
|
|
|
|
|
|
|
private static final Class<DubboTransported> DUBBO_TRANSPORTED_CLASS = DubboTransported.class;
|
|
|
|
private static final Class<DubboTransported> DUBBO_TRANSPORTED_CLASS = DubboTransported.class;
|
|
|
|
|
|
|
|
|
|
|
@ -153,10 +153,10 @@ public class DubboLoadBalancedRestTemplateAutoConfiguration
|
|
|
|
AnnotatedBeanDefinition annotatedBeanDefinition = (AnnotatedBeanDefinition) beanDefinition;
|
|
|
|
AnnotatedBeanDefinition annotatedBeanDefinition = (AnnotatedBeanDefinition) beanDefinition;
|
|
|
|
MethodMetadata factoryMethodMetadata = annotatedBeanDefinition
|
|
|
|
MethodMetadata factoryMethodMetadata = annotatedBeanDefinition
|
|
|
|
.getFactoryMethodMetadata();
|
|
|
|
.getFactoryMethodMetadata();
|
|
|
|
attributes = factoryMethodMetadata != null
|
|
|
|
attributes = factoryMethodMetadata != null ? Optional
|
|
|
|
? Optional.ofNullable(factoryMethodMetadata
|
|
|
|
.ofNullable(factoryMethodMetadata
|
|
|
|
.getAnnotationAttributes(DUBBO_TRANSPORTED_CLASS_NAME)).orElse(attributes)
|
|
|
|
.getAnnotationAttributes(DUBBO_TRANSPORTED_CLASS_NAME))
|
|
|
|
: Collections.emptyMap();
|
|
|
|
.orElse(attributes) : Collections.emptyMap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return attributesResolver.resolve(attributes);
|
|
|
|
return attributesResolver.resolve(attributes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|