mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
Polish alibaba/spring-cloud-alibaba#1661 : [Feature] Introducing Dubbo Gateway
This commit is contained in:
parent
c419c1ef5d
commit
c3173465ea
@ -106,12 +106,12 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- <!– Eureka Service Discovery –>-->
|
<!-- Eureka Service Discovery -->
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>org.springframework.cloud</groupId>-->
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<!-- <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>-->
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||||
<!-- <scope>test</scope>-->
|
<scope>test</scope>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
|
|
||||||
<!-- Zookeeper Service Discovery -->
|
<!-- Zookeeper Service Discovery -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -147,20 +147,20 @@
|
|||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- <!– Spring Cloud Consul –>-->
|
<!-- Spring Cloud Consul -->
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>org.springframework.cloud</groupId>-->
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
|
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
|
||||||
<!-- <version>${spring-cloud-consul.version}</version>-->
|
<version>${spring-cloud-consul.version}</version>
|
||||||
<!-- <scope>test</scope>-->
|
<scope>test</scope>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
|
|
||||||
<!-- <!– Nacos Service Discovery –>-->
|
<!-- Nacos Service Discovery -->
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
<!-- <scope>test</scope>-->
|
<scope>test</scope>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -71,12 +71,12 @@ public class DubboCloudGatewayExecutor {
|
|||||||
DubboGenericServiceFactory serviceFactory,
|
DubboGenericServiceFactory serviceFactory,
|
||||||
DubboGenericServiceExecutionContextFactory contextFactory,
|
DubboGenericServiceExecutionContextFactory contextFactory,
|
||||||
DubboCloudGatewayProperties dubboCloudGatewayProperties,
|
DubboCloudGatewayProperties dubboCloudGatewayProperties,
|
||||||
ObjectProvider<ConversionService> conversionServices) {
|
ObjectProvider<ConversionService> conversionService) {
|
||||||
this.repository = repository;
|
this.repository = repository;
|
||||||
this.serviceFactory = serviceFactory;
|
this.serviceFactory = serviceFactory;
|
||||||
this.contextFactory = contextFactory;
|
this.contextFactory = contextFactory;
|
||||||
this.dubboCloudGatewayProperties = dubboCloudGatewayProperties;
|
this.dubboCloudGatewayProperties = dubboCloudGatewayProperties;
|
||||||
this.conversionService = conversionServices
|
this.conversionService = conversionService
|
||||||
.getIfAvailable(DefaultFormattingConversionService::new);
|
.getIfAvailable(DefaultFormattingConversionService::new);
|
||||||
// TODO : Replace these hard-code configurations
|
// TODO : Replace these hard-code configurations
|
||||||
this.dubboTranslatedAttributes.put("protocol", "dubbo");
|
this.dubboTranslatedAttributes.put("protocol", "dubbo");
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.alibaba.cloud.dubbo.gateway.standard;
|
package com.alibaba.cloud.dubbo.gateway.autoconfigure;
|
||||||
|
|
||||||
import com.alibaba.cloud.dubbo.autoconfigure.DubboMetadataAutoConfiguration;
|
import com.alibaba.cloud.dubbo.autoconfigure.DubboMetadataAutoConfiguration;
|
||||||
import com.alibaba.cloud.dubbo.autoconfigure.DubboServiceAutoConfiguration;
|
import com.alibaba.cloud.dubbo.autoconfigure.DubboServiceAutoConfiguration;
|
||||||
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayExecutor;
|
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayExecutor;
|
||||||
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayProperties;
|
import com.alibaba.cloud.dubbo.gateway.DubboCloudGatewayProperties;
|
||||||
import com.alibaba.cloud.dubbo.gateway.autoconfigure.DubboCloudGatewayAutoConfiguration;
|
import com.alibaba.cloud.dubbo.gateway.standard.DubboSpringCloudGatewayFilter;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
@ -1,3 +1,3 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||||
com.alibaba.cloud.dubbo.gateway.autoconfigure.DubboCloudGatewayAutoConfiguration,\
|
com.alibaba.cloud.dubbo.gateway.autoconfigure.DubboCloudGatewayAutoConfiguration,\
|
||||||
com.alibaba.cloud.dubbo.gateway.standard.DubboSpringCloudGatewayAutoConfiguration
|
com.alibaba.cloud.dubbo.gateway.autoconfigure.DubboSpringCloudGatewayAutoConfiguration
|
@ -31,7 +31,7 @@ public class DubboSpringCloudGatewayBootstrap {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new SpringApplicationBuilder(DubboSpringCloudGatewayBootstrap.class)
|
new SpringApplicationBuilder(DubboSpringCloudGatewayBootstrap.class)
|
||||||
.properties("spring.profiles.active=zookeeper").run(args);
|
.properties("spring.profiles.active=nacos").run(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,3 @@
|
|||||||
spring:
|
|
||||||
application:
|
|
||||||
name: spring-cloud-alibaba-dubbo-gateway
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
|
|
||||||
dubbo:
|
dubbo:
|
||||||
protocols:
|
protocols:
|
||||||
dubbo:
|
dubbo:
|
||||||
@ -11,64 +5,3 @@ dubbo:
|
|||||||
|
|
||||||
server:
|
server:
|
||||||
port: 9090
|
port: 9090
|
||||||
|
|
||||||
# default disable all
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
enabled: false
|
|
||||||
register-enabled: false
|
|
||||||
zookeeper:
|
|
||||||
enabled: false
|
|
||||||
consul:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
eureka:
|
|
||||||
client:
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
spring:
|
|
||||||
profiles: nacos
|
|
||||||
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
username: nacos
|
|
||||||
password: nacos
|
|
||||||
discovery:
|
|
||||||
enabled: true
|
|
||||||
register-enabled: true
|
|
||||||
server-addr: 127.0.0.1:8848
|
|
||||||
ephemeral: false
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
spring:
|
|
||||||
profiles: eureka
|
|
||||||
|
|
||||||
eureka:
|
|
||||||
client:
|
|
||||||
enabled: true
|
|
||||||
service-url:
|
|
||||||
defaultZone: http://127.0.0.1:8761/eureka/
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
spring:
|
|
||||||
profiles: zookeeper
|
|
||||||
cloud:
|
|
||||||
zookeeper:
|
|
||||||
enabled: true
|
|
||||||
connect-string: 127.0.0.1:2181
|
|
||||||
|
|
||||||
|
|
||||||
---
|
|
||||||
spring:
|
|
||||||
profiles: consul
|
|
||||||
|
|
||||||
cloud:
|
|
||||||
consul:
|
|
||||||
enabled: true
|
|
||||||
host: 127.0.0.1
|
|
||||||
port: 8500
|
|
@ -0,0 +1,66 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: spring-cloud-alibaba-dubbo-gateway
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
|
# default disable all
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
enabled: false
|
||||||
|
register-enabled: false
|
||||||
|
zookeeper:
|
||||||
|
enabled: false
|
||||||
|
consul:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles: nacos
|
||||||
|
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
enabled: true
|
||||||
|
register-enabled: true
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles: eureka
|
||||||
|
|
||||||
|
eureka:
|
||||||
|
client:
|
||||||
|
enabled: true
|
||||||
|
service-url:
|
||||||
|
defaultZone: http://127.0.0.1:8761/eureka/
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles: zookeeper
|
||||||
|
cloud:
|
||||||
|
zookeeper:
|
||||||
|
enabled: true
|
||||||
|
connect-string: 127.0.0.1:2181
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
spring:
|
||||||
|
profiles: consul
|
||||||
|
|
||||||
|
cloud:
|
||||||
|
consul:
|
||||||
|
enabled: true
|
||||||
|
host: 127.0.0.1
|
||||||
|
port: 8500
|
Loading…
x
Reference in New Issue
Block a user