提交 32d25653 编写于 作者: 武汉红喜's avatar 武汉红喜

EnableDubbo

上级 2e124088
package org.hongxi.whatsmars.dubbo.demo.consumer;
import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import org.hongxi.whatsmars.dubbo.demo.consumer.rpc.DemoRpc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -9,6 +10,7 @@ import org.springframework.context.ConfigurableApplicationContext;
* Created by javahongxi on 2017/12/4.
*/
@SpringBootApplication
@EnableDubbo(scanBasePackages = "org.hongxi.whatsmars.dubbo.demo.consumer.rpc", multipleConfig = true)
public class ConsumerApplication {
public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(ConsumerApplication.class, args);
......
......@@ -6,4 +6,4 @@ spring:
address: zookeeper://127.0.0.1:2181
module:
name: demo
scan: org.hongxi.whatsmars.dubbo.demo.consumer.rpc
\ No newline at end of file
# scan:
\ No newline at end of file
package org.hongxi.whatsmars.dubbo.demo.provider;
import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
......@@ -9,6 +10,7 @@ import org.springframework.context.annotation.ComponentScan;
*/
@SpringBootApplication
@ComponentScan(value = {"org.hongxi.whatsmars.dubbo"})
@EnableDubbo(scanBasePackages = "org.hongxi.whatsmars.dubbo.demo.provider.resource", multipleConfig = true)
public class ProviderApplication {
public static void main(String[] args) {
SpringApplication.run(ProviderApplication.class, args);
......
......@@ -9,4 +9,4 @@ spring:
port: 20881
module:
name: demo
scan: org.hongxi.whatsmars.dubbo.demo.provider.resource
\ No newline at end of file
# scan:
\ No newline at end of file
......@@ -6,6 +6,7 @@ import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
@Deprecated
public class DubboConfigurationApplicationContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册