Dubbo注册中心Resitry之Redis

<dubbo:registry address="redis://10.20.153.10:6379" />
<dubbo:registry address="redis://10.20.153.10:6379?backup=10.20.153.11:6379,10.20.153.12:6379" />

<dubbo:registry protocol="redis" address="10.20.153.10:6379" />
<dubbo:registry protocol="redis" address="10.20.153.10:6379,10.20.153.11:6379,10.20.153.12:6379" />

数据结构

使用Redis的Hash结构存储数据

使用Redis的Publish/Subscribe事件通知数据变更

调用过程

启动provdier

127.0.0.1:6379> keys *
1) "/dubbo/top.guoj.api.HelloService/providers"
127.0.0.1:6379> type /dubbo/top.guoj.api.HelloService/providers
hash
127.0.0.1:6379> hgetall /dubbo/top.guoj.api.HelloService/providers
1) "dubbo://192.168.100.61:20880/top.guoj.api.HelloService?anyhost=true&application=demo-provider&dubbo=2.6.2&generic=false&interface=top.guoj.api.HelloService&methods=sayHello&pid=5252&side=provider&timestamp=1533106855687"
2) "1533106976445"

启动consumer

127.0.0.1:6379> keys *
1) "/dubbo/top.guoj.api.HelloService/consumers"
2) "/dubbo/top.guoj.api.HelloService/providers"
127.0.0.1:6379> type /dubbo/top.guoj.api.HelloService/consumers
hash
127.0.0.1:6379> hgetall /dubbo/top.guoj.api.HelloService/consumers
1) "consumer://192.168.100.61/top.guoj.api.HelloService?application=dubbo-consumer&category=consumers&check=false&dubbo=2.6.2&interface=top.guoj.api.HelloService&methods=sayHello&pid=7196&side=consumer&timestamp=1533107247126"
2) "1533107337246"
127.0.0.1:6379>

选项