Polish : /spring-cloud-incubator/spring-cloud-alibaba#386 : supports Spring Cloud Netflix Eureka and Spring Cloud Zookeeper
parent
6daba36e35
commit
b3c26c509e
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.registry;
|
||||
|
||||
import com.alibaba.dubbo.common.Constants;
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
import com.alibaba.dubbo.common.utils.NetUtils;
|
||||
|
||||
import org.springframework.cloud.client.DefaultServiceInstance;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.serviceregistry.Registration;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* Abstract {@link RegistrationFactory} implementation
|
||||
* <p>
|
||||
*
|
||||
* @param <T> The subclass of {@link Registration}
|
||||
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
|
||||
*/
|
||||
public abstract class AbstractRegistrationFactory<T extends Registration> implements RegistrationFactory<T> {
|
||||
|
||||
protected ServiceInstance createServiceInstance(String serviceName, URL url) {
|
||||
// Append default category if absent
|
||||
String category = url.getParameter(Constants.CATEGORY_KEY, Constants.DEFAULT_CATEGORY);
|
||||
URL newURL = url.addParameter(Constants.CATEGORY_KEY, category);
|
||||
newURL = newURL.addParameter(Constants.PROTOCOL_KEY, url.getProtocol());
|
||||
String ip = NetUtils.getLocalHost();
|
||||
int port = newURL.getParameter(Constants.BIND_PORT_KEY, url.getPort());
|
||||
DefaultServiceInstance serviceInstance = new DefaultServiceInstance(url.toIdentityString(), serviceName, ip, port, false);
|
||||
serviceInstance.getMetadata().putAll(new LinkedHashMap<>(newURL.getParameters()));
|
||||
return serviceInstance;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.registry;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
|
||||
import org.springframework.cloud.client.serviceregistry.Registration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
* Default {@link RegistrationFactory}
|
||||
*
|
||||
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
|
||||
*/
|
||||
public class DefaultRegistrationFactory extends AbstractRegistrationFactory<Registration> {
|
||||
|
||||
@Override
|
||||
public Registration create(String serviceName, URL url, ApplicationContext applicationContext) {
|
||||
return new DelegatingRegistration(createServiceInstance(serviceName, url));
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.registry;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
|
||||
import org.springframework.cloud.client.serviceregistry.Registration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
|
||||
/**
|
||||
* {@link Registration} Factory to createServiceInstance a instance of {@link Registration}
|
||||
*
|
||||
* @param <T> The subclass of {@link Registration}
|
||||
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
|
||||
*/
|
||||
public interface RegistrationFactory<T extends Registration> {
|
||||
|
||||
/**
|
||||
* Create a instance of {@link T}
|
||||
*
|
||||
* @param serviceName The service name of Dubbo service interface
|
||||
* @param url The Dubbo's URL
|
||||
* @param applicationContext {@link ApplicationContext}
|
||||
* @return a instance of {@link T}
|
||||
*/
|
||||
T create(String serviceName, URL url, ApplicationContext applicationContext);
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.registry.apache.zookeeper;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
|
||||
import org.springframework.cloud.alibaba.dubbo.registry.AbstractRegistrationFactory;
|
||||
import org.springframework.cloud.alibaba.dubbo.registry.RegistrationFactory;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.zookeeper.discovery.ZookeeperInstance;
|
||||
import org.springframework.cloud.zookeeper.serviceregistry.ServiceInstanceRegistration;
|
||||
import org.springframework.cloud.zookeeper.serviceregistry.ZookeeperRegistration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
* Zookeeper {@link RegistrationFactory}
|
||||
*
|
||||
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
|
||||
*/
|
||||
public class ZookeeperRegistrationFactory extends AbstractRegistrationFactory<ZookeeperRegistration> {
|
||||
|
||||
@Override
|
||||
public ZookeeperRegistration create(String serviceName, URL url, ApplicationContext applicationContext) {
|
||||
|
||||
ServiceInstance serviceInstance = createServiceInstance(serviceName, url);
|
||||
|
||||
ZookeeperInstance zookeeperInstance = new ZookeeperInstance(serviceInstance.getInstanceId(),
|
||||
serviceInstance.getServiceId(), serviceInstance.getMetadata());
|
||||
|
||||
ZookeeperRegistration registration = ServiceInstanceRegistration
|
||||
.builder()
|
||||
.address(serviceInstance.getHost())
|
||||
.name(serviceInstance.getServiceId())
|
||||
.payload(zookeeperInstance)
|
||||
.port(serviceInstance.getPort())
|
||||
.build();
|
||||
|
||||
return registration;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.registry.netflix.eureka;
|
||||
|
||||
import com.alibaba.dubbo.common.URL;
|
||||
|
||||
import com.netflix.appinfo.HealthCheckHandler;
|
||||
import com.netflix.discovery.EurekaClientConfig;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.cloud.alibaba.dubbo.registry.AbstractRegistrationFactory;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.commons.util.InetUtils;
|
||||
import org.springframework.cloud.netflix.eureka.CloudEurekaInstanceConfig;
|
||||
import org.springframework.cloud.netflix.eureka.EurekaInstanceConfigBean;
|
||||
import org.springframework.cloud.netflix.eureka.serviceregistry.EurekaRegistration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
/**
|
||||
* {@link EurekaRegistration} Factory
|
||||
*
|
||||
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
|
||||
*/
|
||||
public class EurekaRegistrationFactory extends AbstractRegistrationFactory<EurekaRegistration> {
|
||||
|
||||
@Override
|
||||
public EurekaRegistration create(String serviceName, URL url, ApplicationContext applicationContext) {
|
||||
ServiceInstance serviceInstance = createServiceInstance(serviceName, url);
|
||||
CloudEurekaInstanceConfig cloudEurekaInstanceConfig = applicationContext.getBean(CloudEurekaInstanceConfig.class);
|
||||
ObjectProvider<HealthCheckHandler> healthCheckHandler = applicationContext.getBeanProvider(HealthCheckHandler.class);
|
||||
EurekaClientConfig eurekaClientConfig = applicationContext.getBean(EurekaClientConfig.class);
|
||||
InetUtils inetUtils = applicationContext.getBean(InetUtils.class);
|
||||
EurekaInstanceConfigBean eurekaInstanceConfigBean = new EurekaInstanceConfigBean(inetUtils);
|
||||
BeanUtils.copyProperties(cloudEurekaInstanceConfig, eurekaInstanceConfigBean);
|
||||
String serviceId = serviceInstance.getServiceId();
|
||||
eurekaInstanceConfigBean.setInstanceId(serviceInstance.getInstanceId());
|
||||
eurekaInstanceConfigBean.setVirtualHostName(serviceId);
|
||||
eurekaInstanceConfigBean.setSecureVirtualHostName(serviceId);
|
||||
eurekaInstanceConfigBean.setAppname(serviceId);
|
||||
eurekaInstanceConfigBean.setHostname(serviceInstance.getHost());
|
||||
eurekaInstanceConfigBean.setMetadataMap(serviceInstance.getMetadata());
|
||||
|
||||
return EurekaRegistration.builder(eurekaInstanceConfigBean)
|
||||
.with(healthCheckHandler)
|
||||
.with(eurekaClientConfig, applicationContext)
|
||||
.build();
|
||||
}
|
||||
}
|
@ -1,222 +0,0 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.bootstrap;
|
||||
|
||||
import com.alibaba.dubbo.config.annotation.Reference;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.alibaba.dubbo.annotation.DubboTransported;
|
||||
import org.springframework.cloud.alibaba.dubbo.service.RestService;
|
||||
import org.springframework.cloud.alibaba.dubbo.service.User;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;
|
||||
|
||||
/**
|
||||
* Dubbo Spring Cloud Bootstrap
|
||||
*/
|
||||
@EnableDiscoveryClient
|
||||
@EnableAutoConfiguration
|
||||
@EnableFeignClients
|
||||
@RestController
|
||||
public class DubboSpringCloudBootstrap {
|
||||
|
||||
@Reference(version = "1.0.0")
|
||||
private RestService restService;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FeignRestService feignRestService;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DubboFeignRestService dubboFeignRestService;
|
||||
|
||||
@Autowired
|
||||
@LoadBalanced
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@FeignClient("spring-cloud-alibaba-dubbo")
|
||||
public interface FeignRestService {
|
||||
|
||||
@GetMapping(value = "/param")
|
||||
String param(@RequestParam("param") String param);
|
||||
|
||||
@PostMapping("/params")
|
||||
public String params(@RequestParam("b") String b, @RequestParam("a") int a);
|
||||
|
||||
@PostMapping(value = "/request/body/map", produces = APPLICATION_JSON_UTF8_VALUE)
|
||||
User requestBody(@RequestParam("param") String param, @RequestBody Map<String, Object> data);
|
||||
|
||||
@GetMapping("/headers")
|
||||
@Path("/headers")
|
||||
@GET
|
||||
public String headers(@RequestHeader("h2") String header2,
|
||||
@RequestHeader("h") String header,
|
||||
@RequestParam("v") Integer value);
|
||||
|
||||
@GetMapping("/path-variables/{p1}/{p2}")
|
||||
public String pathVariables(@PathVariable("p2") String path2,
|
||||
@PathVariable("p1") String path1,
|
||||
@RequestParam("v") String param);
|
||||
}
|
||||
|
||||
@FeignClient("spring-cloud-alibaba-dubbo")
|
||||
@DubboTransported
|
||||
public interface DubboFeignRestService {
|
||||
|
||||
@GetMapping(value = "/param")
|
||||
String param(@RequestParam("param") String param);
|
||||
|
||||
@PostMapping("/params")
|
||||
String params(@RequestParam("b") String paramB, @RequestParam("a") int paramA);
|
||||
|
||||
@PostMapping(value = "/request/body/map", produces = APPLICATION_JSON_UTF8_VALUE)
|
||||
User requestBody(@RequestParam("param") String param, @RequestBody Map<String, Object> data);
|
||||
|
||||
@GetMapping("/headers")
|
||||
@Path("/headers")
|
||||
@GET
|
||||
public String headers(@RequestHeader("h2") String header2,
|
||||
@RequestParam("v") Integer value,
|
||||
@RequestHeader("h") String header);
|
||||
|
||||
@GetMapping("/path-variables/{p1}/{p2}")
|
||||
public String pathVariables(@RequestParam("v") String param,
|
||||
@PathVariable("p2") String path2,
|
||||
@PathVariable("p1") String path1);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public ApplicationRunner paramRunner() {
|
||||
return arguments -> {
|
||||
|
||||
// To call /path-variables
|
||||
callPathVariables();
|
||||
|
||||
// To call /headers
|
||||
callHeaders();
|
||||
|
||||
// To call /param
|
||||
callParam();
|
||||
|
||||
// To call /params
|
||||
callParams();
|
||||
|
||||
// To call /request/body/map
|
||||
callRequestBodyMap();
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
private void callPathVariables() {
|
||||
// Dubbo Service call
|
||||
System.out.println(restService.pathVariables("a", "b", "c"));
|
||||
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
||||
System.out.println(dubboFeignRestService.pathVariables("c", "b", "a"));
|
||||
// Spring Cloud Open Feign REST Call
|
||||
System.out.println(feignRestService.pathVariables("b", "a", "c"));
|
||||
|
||||
// RestTemplate call
|
||||
System.out.println(restTemplate.getForEntity("http://spring-cloud-alibaba-dubbo//path-variables/{p1}/{p2}?v=c", String.class, "a", "b"));
|
||||
}
|
||||
|
||||
private void callHeaders() {
|
||||
// Dubbo Service call
|
||||
System.out.println(restService.headers("a", "b", 10));
|
||||
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
||||
System.out.println(dubboFeignRestService.headers("b", 10, "a"));
|
||||
// Spring Cloud Open Feign REST Call
|
||||
System.out.println(feignRestService.headers("b", "a", 10));
|
||||
}
|
||||
|
||||
private void callParam() {
|
||||
// Dubbo Service call
|
||||
System.out.println(restService.param("mercyblitz"));
|
||||
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
||||
System.out.println(dubboFeignRestService.param("mercyblitz"));
|
||||
// Spring Cloud Open Feign REST Call
|
||||
System.out.println(feignRestService.param("mercyblitz"));
|
||||
}
|
||||
|
||||
private void callParams() {
|
||||
// Dubbo Service call
|
||||
System.out.println(restService.params(1, "1"));
|
||||
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
||||
System.out.println(dubboFeignRestService.params("1", 1));
|
||||
// Spring Cloud Open Feign REST Call
|
||||
System.out.println(feignRestService.params("1", 1));
|
||||
|
||||
// RestTemplate call
|
||||
System.out.println(restTemplate.getForEntity("http://spring-cloud-alibaba-dubbo/param?param=小马哥", String.class));
|
||||
}
|
||||
|
||||
private void callRequestBodyMap() {
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("id", 1);
|
||||
data.put("name", "小马哥");
|
||||
data.put("age", 33);
|
||||
|
||||
// Dubbo Service call
|
||||
System.out.println(restService.requestBodyMap(data, "Hello,World"));
|
||||
// Spring Cloud Open Feign REST Call (Dubbo Transported)
|
||||
// System.out.println(dubboFeignRestService.requestBody("Hello,World", data));
|
||||
// Spring Cloud Open Feign REST Call
|
||||
System.out.println(feignRestService.requestBody("Hello,World", data));
|
||||
|
||||
// RestTemplate call
|
||||
System.out.println(restTemplate.postForObject("http://spring-cloud-alibaba-dubbo/request/body/map?param=小马哥", data, User.class));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@LoadBalanced
|
||||
@DubboTransported
|
||||
public RestTemplate restTemplate() {
|
||||
return new RestTemplate();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(DubboSpringCloudBootstrap.class)
|
||||
.run(args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.cloud.alibaba.dubbo.bootstrap;
|
||||
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
|
||||
/**
|
||||
* Dubbo Spring Cloud Provider Bootstrap
|
||||
*/
|
||||
@EnableDiscoveryClient
|
||||
@EnableAutoConfiguration
|
||||
public class DubboSpringCloudProviderBootstrap {
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SpringApplicationBuilder(DubboSpringCloudProviderBootstrap.class)
|
||||
.run(args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
8
spring-cloud-alibaba-dubbo/src/test/java/org/springframework/cloud/alibaba/dubbo/service/StandardRestService.java → spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-sample/src/main/java/org/springframework/cloud/alibaba/dubbo/service/StandardRestService.java
8
spring-cloud-alibaba-dubbo/src/test/java/org/springframework/cloud/alibaba/dubbo/service/StandardRestService.java → spring-cloud-alibaba-examples/spring-cloud-alibaba-dubbo-examples/spring-cloud-dubbo-provider-sample/src/main/java/org/springframework/cloud/alibaba/dubbo/service/StandardRestService.java
Loading…
Reference in New Issue