Redis Protocol
Redis Protocol
RPC protocol implemented based on Redis 1.
Tip
Supports versions above 2.3.0
Register Redis Service Address
RegistryFactory registryFactory = ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
Registry registry = registryFactory.getRegistry(URL.valueOf("zookeeper://10.20.153.10:2181"));
registry.register(URL.valueOf("redis://10.20.153.11/com.foo.BarService?category=providers&dynamic=false&application=foo&group=member&loadbalance=consistenthash"));
Referencing on the Client Side
Use on the client side 2:
<dubbo:reference id="store" interface="java.util.Map" group="member" />
Alternatively, point-to-point direct connection:
<dubbo:reference id="store" interface="java.util.Map" url="redis://10.20.153.10:6379" />
You can also use a custom interface:
<dubbo:reference id="store" interface="com.foo.StoreService" url="redis://10.20.153.10:6379" />
It is recommended that the method names match the standard Redis method names, namely: get(key), set(key, value), delete(key).
If the method names differ from the standard Redis method names, you will need to configure the mapping 3:
<dubbo:reference id="cache" interface="com.foo.CacheService" url="redis://10.20.153.10:6379" p:set="putFoo" p:get="getFoo" p:delete="removeFoo" />
Feedback
Was this page helpful?
Yes No
Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)