You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "qixiaobo (GitHub)" <gi...@apache.org> on 2019/10/12 10:17:12 UTC

[GitHub] [dubbo] qixiaobo commented on issue #5163: Dubbo 多个接口泛化调用bug

maybe this code
```java
public void addConsumer(ConsumerConfig consumerConfig) {
        if (consumerConfig == null) {
            return;
        }

        String key = StringUtils.isNotEmpty(consumerConfig.getId())
                ? consumerConfig.getId()
                : (consumerConfig.isDefault() == null || consumerConfig.isDefault()) ? DEFAULT_KEY : null;

        if (StringUtils.isEmpty(key)) {
            throw new IllegalStateException("A ConsumerConfig should either has an id or it's the default one, " + consumerConfig);
        }

        if (consumers.containsKey(key) && !consumerConfig.equals(consumers.get(key))) {
            logger.warn("Duplicate ConsumerConfig found, there already has one default ConsumerConfig or more than two ConsumerConfigs have the same id, " +
                                                    "you can try to give each ConsumerConfig a different id. " + consumerConfig);
        } else {
            consumers.put(key, consumerConfig);
        }
    }
```

[ Full content available at: https://github.com/apache/dubbo/issues/5163 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org