Metadata Center Extension

aim of design

See the Metadata Center Manual

Extension ports


Known extensions

Implementation principle

SPI definition


public interface MetadataReportFactory {
    MetadataReport getMetadataReport(URL url);

Custom metadata storage

The following uses Redis storage as an example for illustration.

To create a new project, you need to support the following modifications:

Extend AbstractMetadataReport

public class RedisMetadataReport extends AbstractMetadataReport {
    private final static Logger logger = LoggerFactory. getLogger(RedisMetadataReport. class);
    final JedisPool pool;

    public RedisMetadataReport(URL url) {
        pool = new JedisPool(new JedisPoolConfig(), url. getHost(), url. getPort());
    protected void doStoreProviderMetadata(ProviderMetadataIdentifier providerMetadataIdentifier, String serviceDefinitions) {
        this.storeMetadata(providerMetadataIdentifier, serviceDefinitions);
    protected void doStoreConsumerMetadata(ConsumerMetadataIdentifier consumerMetadataIdentifier, String value) {
        this.storeMetadata(consumerMetadataIdentifier, value);
    private void storeMetadata(MetadataIdentifier metadataIdentifier, String v) {
        try (Jedis jedis = pool. getResource()) {
            jedis.set(metadataIdentifier.getIdentifierKey() + META_DATA_SOTRE_TAG, v);
        } catch (Throwable e) {
            logger.error("Failed to put " + metadataIdentifier + " to redis " + v + ", cause: " + e.getMessage(), e);
            throw new RpcException("Failed to put " + metadataIdentifier + " to redis " + v + ", cause: " + e.getMessage(), e);

Extends AbstractMetadataReportFactory

public class RedisMetadataReportFactory extends AbstractMetadataReportFactory {
    public MetadataReport createMetadataReport(URL url) {
        return new RedisMetadataReport(url);

Add MetadataReportFactory


Just pack the above modification and project into a jar package, and then configure the url of the metadata center: redis://

At this point, a custom metadata store is ready to run.

Last modified January 2, 2023: Enhance en docs (#1798) (95a9f4f6c1c)