public interface HelloService { String sayHello(String name); } public class HelloServiceImpl implements HelloService { public String sayHello(String name) { return "Hello, " + name; } } <dubbo:application name="demo-provider" /> <dubbo:registry address="zookeeper://localhost:2181" /> <dubbo:protocol name="dubbo" port="20880" /> <dubbo:service interface="com.example.HelloService" ref="helloService" /> <bean id="helloService" class="com.example.HelloServiceImpl" /> <dubbo:application name="demo-consumer" /> <dubbo:registry address="zookeeper://localhost:2181" /> <dubbo:reference interface="com.example.HelloService" id="helloService" />


上一篇:
下一篇:
切换中文