1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00
This commit is contained in:
mercyblitz
2019-03-29 19:58:00 +08:00
parent ba569af8bc
commit 8218c9d38b
11 changed files with 211 additions and 35 deletions

View File

@@ -17,6 +17,7 @@
package org.springframework.cloud.alibaba.dubbo.bootstrap;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationRunner;
@@ -52,7 +53,7 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;
@EnableFeignClients
public class DubboSpringCloudConsumerBootstrap {
@Reference(version = "1.0.0")
@Reference(version = "1.0.0", protocol = "dubbo")
private RestService restService;
@Autowired
@@ -94,7 +95,7 @@ public class DubboSpringCloudConsumerBootstrap {
}
@FeignClient("${provider.application.name}")
@DubboTransported()
@DubboTransported(protocol = "dubbo")
public interface DubboFeignRestService {
@GetMapping(value = "/param")

View File

@@ -9,4 +9,4 @@ server:
provider:
application:
name: spring-cloud-alibaba-dubbo-web-provider
name: spring-cloud-alibaba-dubbo-provider

View File

@@ -17,6 +17,13 @@
<dependencies>
<!-- Resolve the Dubbo REST RPC issue -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- Resolve the Spring Cloud registration issue -->
<dependency>
<groupId>org.springframework</groupId>

View File

@@ -16,6 +16,7 @@
*/
package org.springframework.cloud.alibaba.dubbo.bootstrap;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@@ -30,6 +31,7 @@ public class DubboSpringCloudProviderBootstrap {
public static void main(String[] args) {
new SpringApplicationBuilder(DubboSpringCloudProviderBootstrap.class)
.properties("spring.profiles.active=nacos")
.web(WebApplicationType.NONE)
.run(args);
}
}