Commit b228c6a2 by yangjinjue

修改readme

parent aa56b08a
...@@ -29,30 +29,27 @@ spring.dubbo.module.default=false ...@@ -29,30 +29,27 @@ spring.dubbo.module.default=false
``` ```
### 2. 客户端介绍
### 1. 服务端介绍
* 配置文件 `application.properties` * 配置文件 `application.properties`
``` ```
spring.dubbo.application.name=provider spring.dubbo.application.name=consumer
spring.dubbo.registry.address=zookeeper://localhost:2181 spring.dubbo.registry.address=zookeeper://localhost:2181
spring.dubbo.protocol.name=dubbo spring.dubbo.scan=com.zhiwei.demo.client
spring.dubbo.protocol.port=20879
spring.dubbo.protocol.host=localhost
spring.dubbo.scan=com.zhiwei.demo.server
spring.dubbo.module.default=false spring.dubbo.module.default=false
``` ```
`spring.dubbo.scan`表示要扫描的`package`目录。 `spring.dubbo.scan`表示要扫描的`package`目录。
* 启动入口 `com.zhiwei.demo.server.Server` * 启动入口 `com.zhiwei.demo.client.Client`
``` ```
@SpringBootApplication @SpringBootApplication
public class Server { public class Client {
private static Logger logger = LoggerFactory.getLogger(Server.class); private static Logger logger = LoggerFactory.getLogger(Client.class);
public static void main(String[] args) { public static void main(String[] args) {
logger.info("SpringBoot initial Before"); ConfigurableApplicationContext run = SpringApplication.run(Client.class, args);
ConfigurableApplicationContext run = SpringApplication.run(Server.class, args); HelloService helloService = run.getBean(HelloService.class);
logger.info("SpringBoot initial After"); logger.info(helloService.hello("hello"));
} }
} }
``` ```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment