@YoungHu My mistake. But the following code can also get the right response.

```java
        // not start provider, just run client 
        ReferenceConfig<DemoService> reference = new ReferenceConfig<>();
        reference.setApplication(new ApplicationConfig("first-dubbo-client"));
        reference.setRegistry(new RegistryConfig("multicast://224.5.6.7:1234"));
        reference.setInterface(DemoService.class);

        ReferenceConfigCache cache = ReferenceConfigCache.getCache();
        try {
            DemoService greetingsService = cache.get(reference);

            String message = greetingsService.sayHello("dubbo");
            System.out.println(message);
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.in.read(); // start provider before continuing

        DemoService greetingsService = cache.get(reference);
        // GreetingsService greetingsService = reference.get();
        String message = greetingsService.sayHello("dubbo");
        System.out.println(message);
```

So what's my code's problem ?

[ Full content available at: 
https://github.com/apache/incubator-dubbo/pull/2347 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to