RPC protocol based on memcached 1.
2.3.0
and aboveRegistryFactory registryFactory = ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension();
Registry registry = registryFactory.getRegistry(URL.valueOf("zookeeper://10.20.153.10:2181"));
registry.register(URL.valueOf("memcached://10.20.153.11/com.foo.BarService?category=providers&dynamic=false&application=foo&group=member&loadbalance=consistenthash"));
Use on the client side 2:
<dubbo:reference id="cache" interface="java.util.Map" group="member" />
Or, connect directly point-to-point:
<dubbo:reference id="cache" interface="java.util.Map" url="memcached://10.20.153.10:11211" />
Custom interfaces can also be used:
<dubbo:reference id="cache" interface="com.foo.CacheService" url="memcached://10.20.153.10:11211" />
It is recommended that method names match the standard method names of memcached, namely: get(key), set(key, value), delete(key).
If the method names do not match the standard method names of memcached, a mapping relationship needs to be configured 3:
<dubbo:reference id="cache" interface="com.foo.CacheService" url="memcached://10.20.153.10:11211" p:set="putFoo" p:get="getFoo" p:delete="removeFoo" />