Commit b228c6a2 by yangjinjue

修改readme

parent aa56b08a
......@@ -29,30 +29,27 @@ spring.dubbo.module.default=false
```
### 1. 服务端介绍
### 2. 客户端介绍
* 配置文件 `application.properties`
```
spring.dubbo.application.name=provider
spring.dubbo.application.name=consumer
spring.dubbo.registry.address=zookeeper://localhost:2181
spring.dubbo.protocol.name=dubbo
spring.dubbo.protocol.port=20879
spring.dubbo.protocol.host=localhost
spring.dubbo.scan=com.zhiwei.demo.server
spring.dubbo.scan=com.zhiwei.demo.client
spring.dubbo.module.default=false
```
`spring.dubbo.scan`表示要扫描的`package`目录。
* 启动入口 `com.zhiwei.demo.server.Server`
* 启动入口 `com.zhiwei.demo.client.Client`
```
@SpringBootApplication
public class Server {
private static Logger logger = LoggerFactory.getLogger(Server.class);
public static void main(String[] args) {
logger.info("SpringBoot initial Before");
ConfigurableApplicationContext run = SpringApplication.run(Server.class, args);
logger.info("SpringBoot initial After");
}
}
public class Client {
private static Logger logger = LoggerFactory.getLogger(Client.class);
public static void main(String[] args) {
ConfigurableApplicationContext run = SpringApplication.run(Client.class, args);
HelloService helloService = run.getBean(HelloService.class);
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