Redis protocol

Feature description

RPC protocol implemented based on Redis. 2.3.0 and above are supported.

Redis is an efficient KV storage server.

scenes to be used

Caching, current limiting, distributed locks, etc.

How to use

Import dependencies

Starting from Dubbo 3, the Redis protocol is no longer embedded in Dubbo, and an independent module needs to be introduced separately.


Register the address of the redis service

RegistryFactory registryFactory = ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
Registry registry = registryFactory.getRegistry(URL.valueOf("zookeeper://"));

Referenced on the client side

Does not need to be aware of Redis addresses

On the client side use:

<dubbo:reference id="store" interface="java.util.Map" group="member" />

Or point-to-point direct connection:

<dubbo:reference id="store" interface="java.util.Map" url="redis://" />

It is also possible to use a custom interface:

<dubbo:reference id="store" interface="" url="redis://" />

Where “p:xxx” is the standard p tag of spring

<dubbo:reference id="cache" interface="" url="redis://" p:set="putFoo" p:get="getFoo" p:delete=" removeFoo" />

The method name is suggested to be the same as the standard method name of redis, namely: get(key), set(key, value), delete(key).

If the method name is different from the standard method name of redis, you need to configure the mapping relationship:

Last modified February 22, 2023: Merge refactor website (#2293) (4517e8c1c9c)