<dubbo:application name="provider" /> <dubbo:registry address="zookeeper://127.0.0.1:2181" /> <dubbo:protocol name="dubbo" port="20880" /> <dubbo:service interface="com.example.service.UserService" ref="userService" /> <bean id="userService" class="com.example.service.impl.UserServiceImpl" /> <dubbo:application name="consumer" /> <dubbo:registry address="zookeeper://127.0.0.1:2181" /> <dubbo:reference interface="com.example.service.UserService" id="userService" /> <bean id="userService" class="com.example.consumer.UserServiceConsumer" /> public interface UserService { void addUser(User user); void updateUser(User user); void deleteUser(String userId); User getUser(String userId); } public class UserServiceImpl implements UserService { @Override public void addUser(User user) { } }


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