提交 8c3ffd0b 编写于 作者: 小傅哥's avatar 小傅哥

feat: 模拟RPC请求

上级 e68f64cf
...@@ -31,8 +31,8 @@ public class RPCProxyBeanFactory implements FactoryBean<IUserService>, Runnable ...@@ -31,8 +31,8 @@ public class RPCProxyBeanFactory implements FactoryBean<IUserService>, Runnable
public RPCProxyBeanFactory() throws InterruptedException { public RPCProxyBeanFactory() throws InterruptedException {
new Thread(this).start(); new Thread(this).start();
while (null == channel) { while (null == channel) {
Thread.sleep(150); Thread.sleep(550);
log.info("Rpc Socket 链接等待..."); log.info("Rpc Socket 链接等待,需要启动 xfg-dev-tech-dubbo 默认提供 127.0.0.1:22881 链接地址...");
} }
} }
......
...@@ -19,9 +19,10 @@ import javax.annotation.Resource; ...@@ -19,9 +19,10 @@ import javax.annotation.Resource;
@SpringBootTest @SpringBootTest
public class ApiTest { public class ApiTest {
// 直连模式; // 测试使用直连模式;
@DubboReference(interfaceClass = IUserService.class, url = "dubbo://127.0.0.1:20881", version = "1.0.0") // @DubboReference(interfaceClass = IUserService.class, url = "dubbo://127.0.0.1:20881", version = "1.0.0")
// @DubboReference(interfaceClass = IUserService.class, version = "1.0.0") // 测试注册中心模式;需要配置 Zookeeper
@DubboReference(interfaceClass = IUserService.class, version = "1.0.0")
private IUserService userService; private IUserService userService;
@Resource(name = "rpcProxyBeanFactory") @Resource(name = "rpcProxyBeanFactory")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册