* 启动provider

dubbo-demo-api-provider

* 启动consumer

dubbo-demo-api-consumer

consumer设置generic

```java
    public static void main(String[] args) {
        ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("dubbo-demo-api-consumer"));
        reference.setRegistry(new RegistryConfig("zookeeper://127.0.0.1:2181"));
        reference.setInterface(DemoService.class);
        reference.setGeneric(true);
        
        Object obj = reference.get();
        for(Class c : obj.getClass().getInterfaces()) {
            System.err.println(c);
        }
        DemoService service = reference.get();
        String message = service.sayHello("dubbo");
        System.out.println(message);
    }
```

客户端会报错：

```
Exception in thread "main" java.lang.ClassCastException: org.apache.dubbo.common.bytecode.proxy0 cannot be cast to org.apache.dubbo.demo.DemoService
	at org.apache.dubbo.demo.consumer.Application.main(Application.java:42)
```
if ("false".equals(retryValue)) {
                        map.put(methodConfig.getName() + ".retries", "0");
                    }
                }
                AsyncMethodInfo asyncMethodInfo = AbstractConfig.convertMethodConfig2AsyncInfo(methodConfig);
                if (asyncMethodInfo != null) {
//                    
                    attributes.put(methodConfig.getName(), asyncMethodInfo);
                }
            }
        }
        String hostToRegistry = ConfigUtils.getSystemProperty(DUBBO_IP_TO_REGISTRY);
        if (StringUtils.isEmpty(hostToRegistry)) {
            hostToRegistry = NetUtils.getLocalHost();
        } else if (isInvalidLocalHost(hostToRegistry)) {
            throw new IllegalArgumentException("Specified invalid registry ip from property:" + DUBBO_IP_TO_REGISTRY + ", value:" + hostToRegistry);
        }
        map.put(REGISTER_IP_KEY, hostToRegistry);
        serviceMetadata.getAttachments().putAll(map);
        ref = createProxy(map);
        serviceMetadata.setTarget(ref);
        serviceMetadata.addAttribute(PROXY_CLASS_REF, ref);
        ConsumerModel consumerModel = repository.lookupReferredService(serviceMetadata.getServiceKey());
        consumerModel.setProxyObject(ref);
        consumerModel.init(attributes);
        initialized = true;
        // 
        dispatch(new ReferenceConfigInitializedEvent(this, invoker));
    }
    @SuppressWarnings({"unchecked", "rawtypes", "deprecation"})