Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xyz327/dubbo-example
dubbo example
https://github.com/xyz327/dubbo-example
Last synced: about 1 month ago
JSON representation
dubbo example
- Host: GitHub
- URL: https://github.com/xyz327/dubbo-example
- Owner: xyz327
- License: mit
- Created: 2018-05-29T08:56:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T11:22:01.000Z (over 6 years ago)
- Last Synced: 2023-03-03T10:23:26.802Z (almost 2 years ago)
- Language: Java
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dubbo-example
dubbo example由于要切换到apache的原因 dubbo的spring的xml文件的xsd schema属性有所变化,配置不对时spring启动时会报错
```
BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://dubbo.apache.org/schema/dubbo]
```
> 2.6.1
```xml```
> 2.6.1之后
```xml```
## xml 属性
|标签名|说明|
|:----:|:---:|
|[dubbo:application](./doc/application.md) | 配置当前应用信息,不管该应用是提供者还是消费者|
|[dubbo:protocol](./doc/protocol.md) | 配置提供服务的协议信息,协议由提供方指定,消费方被动接受|
|[dubbo:registry](./doc/registry.md)| 用于配置连接注册中心相关信息|
## 方法参数回调
> 接口
```java
public interface CallbackService {
void callback(String mag, Consumer callback);
}
```
> 服务提供者
```java
public class CallbackServiceImpl implements CallbackService {
@Override
public void callback(String msg, Consumer callback) {
callback.accept(msg+"---"+System.currentTimeMillis());
}
}
```
```xml
```
> 服务消费者
```xml```