mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish spring-cloud-incubator/spring-cloud-alibaba#553 : Dubbo Spring Cloud service invocations failed without REST protocol
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnNotWebApplication;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.event.ApplicationStartedEvent;
|
||||
import org.springframework.cloud.alibaba.dubbo.registry.event.ServiceInstancePreRegisteredEvent;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.serviceregistry.Registration;
|
||||
@@ -77,6 +78,10 @@ public class DubboServiceRegistrationNonWebApplicationAutoConfiguration {
|
||||
@EventListener(ServiceBeanExportedEvent.class)
|
||||
public void onServiceBeanExported(ServiceBeanExportedEvent event) {
|
||||
setWebPort(event.getServiceBean());
|
||||
}
|
||||
|
||||
@EventListener(ApplicationStartedEvent.class)
|
||||
public void onApplicationStarted() {
|
||||
register();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user