Git Product home page Git Product logo

dubbo-mock's People

Contributors

dependabot[bot] avatar tonyruiyu avatar wujun8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dubbo-mock's Issues

规则相关功能

服务Mock规则, {测试}、{新增} 按钮默认置灰,用不了,是前端问题吗

只是页面操作么,没有实现真正的dubbo mock吗?还是少了操作啦?

哈咯,这边项目拉下来跑了起来,然后也按照你的介绍录了些相关数据,在页面上配置相关的zk地址dubbo服务地址,然后自己写一点规则,都是是页面上的展现呀,这边的mock精华是我还没有体会到么?一脸懵逼。。。这边我看pmo里面还配置了javassist的版本,但是没有看到引包,是作者分享的整个项目吗?

消费者调用失败,No provider available for the service

现象

本地启动项目并注册服务和方法,使用dubbo调用该方法,报错
Failed to check the status of the service com.scarb.test.TestService. No provider available for the service com.scarb.test.TestService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=app&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776 to the consumer 10.0.75.1 use dubbo version 2.5.3

重现方法

注册服务提供者

在本地用启动项目web端,注册了一个服务并添加一个Mock方法,如图。
Snipaste_2019-03-27_01-10-11
Snipaste_2019-03-27_01-10-28
打印日志

2019-03-27 01:01:43,374 INFO [com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry,http-nio-8088-exec-1] - < [DUBBO] Register: dubbo://10.0.75.1:8788/com.scarb.test.TestService?anyhost=true&application=app&dubbo=2.5.3&generic=true&group=group&interface=com.scarb.test.TestService&methods=*&pid=4060&retries=5&side=provider&timeout=50000&timestamp=1553619703373, dubbo version: 2.5.3, current host: 127.0.0.1>
2019-03-27 01:01:43,383 INFO [com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry,http-nio-8088-exec-1] - < [DUBBO] Subscribe: provider://10.0.75.1:8788/com.scarb.test.TestService?anyhost=true&application=app&category=configurators&check=false&dubbo=2.5.3&generic=true&group=group&interface=com.scarb.test.TestService&methods=*&pid=4060&retries=5&side=provider&timeout=50000&timestamp=1553619703373, dubbo version: 2.5.3, current host: 127.0.0.1>
2019-03-27 01:01:43,389 INFO [com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry,http-nio-8088-exec-1] - < [DUBBO] Notify urls for subscribe url provider://10.0.75.1:8788/com.scarb.test.TestService?anyhost=true&application=app&category=configurators&check=false&dubbo=2.5.3&generic=true&group=group&interface=com.scarb.test.TestService&methods=*&pid=4060&retries=5&side=provider&timeout=50000&timestamp=1553619703373, urls: [empty://10.0.75.1:8788/com.scarb.test.TestService?anyhost=true&application=app&category=configurators&check=false&dubbo=2.5.3&generic=true&group=group&interface=com.scarb.test.TestService&methods=*&pid=4060&retries=5&side=provider&timeout=50000&timestamp=1553619703373], dubbo version: 2.5.3, current host: 127.0.0.1>

用消费者调用

实现TestService接口

package com.scarb.test;

public interface TestService {
    String testString();
}

然后编写消费者如下

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
import com.alibaba.dubbo.rpc.service.GenericService;
import com.scarb.test.TestService;

public class MockTestConsumer {

    private static TestService testService;

    public static void main(String[] args) throws Exception{
        ApplicationConfig application = new ApplicationConfig();
        application.setName("app");

        RegistryConfig registry = new RegistryConfig();
        registry.setAddress("zookeeper://127.0.0.1:2181");
        registry.setGroup("group");

        application.setRegistry(registry);

        ReferenceConfig<GenericService> reference = new ReferenceConfig<GenericService>();
        // 弱类型接口名
        reference.setInterface(TestService.class);
        reference.setApplication(application);

        TestService testService = (TestService) reference.get();
        System.out.println(testService.testString());
    }
}

用该程序尝试调用Mock接口,报错,如下

[27/03/19 01:02:33:033 CST] main-SendThread(activate.navicat.com:2181)  INFO zookeeper.ClientCnxn: Socket connection established to activate.navicat.com/127.0.0.1:2181, initiating session
[27/03/19 01:02:33:033 CST] main-SendThread(activate.navicat.com:2181)  INFO zookeeper.ClientCnxn: Session establishment complete on server activate.navicat.com/127.0.0.1:2181, sessionid = 0x100058eef05001c, negotiated timeout = 30000
[27/03/19 01:02:33:033 CST] main-EventThread  INFO zkclient.ZkClient: zookeeper state changed (SyncConnected)
[27/03/19 01:02:33:033 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Register: consumer://10.0.75.1/com.scarb.test.TestService?application=app&category=consumers&check=false&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776, dubbo version: 2.5.3, current host: 10.0.75.1
[27/03/19 01:02:33:033 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Subscribe: consumer://10.0.75.1/com.scarb.test.TestService?application=app&category=providers,configurators,routers&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776, dubbo version: 2.5.3, current host: 10.0.75.1
[27/03/19 01:02:34:034 CST] main  INFO zookeeper.ZookeeperRegistry:  [DUBBO] Notify urls for subscribe url consumer://10.0.75.1/com.scarb.test.TestService?application=app&category=providers,configurators,routers&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776, urls: [empty://10.0.75.1/com.scarb.test.TestService?application=app&category=providers&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776, empty://10.0.75.1/com.scarb.test.TestService?application=app&category=configurators&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776, empty://10.0.75.1/com.scarb.test.TestService?application=app&category=routers&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776], dubbo version: 2.5.3, current host: 10.0.75.1
Exception in thread "main" java.lang.IllegalStateException: Failed to check the status of the service com.scarb.test.TestService. No provider available for the service com.scarb.test.TestService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=app&dubbo=2.5.3&interface=com.scarb.test.TestService&methods=testString&pid=8300&side=consumer&timestamp=1553619744776 to the consumer 10.0.75.1 use dubbo version 2.5.3
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:420)
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300)
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138)
	at MockTestConsumer.main(MockTestConsumer.java:25)

求助

试了很久始终无法成功调用mock,所以求助
是调用方法错误还是其他问题?
能否提供成功调用Mock的示例?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.