Coder Social home page Coder Social logo

dubbo-rpc-jsonrpc's Issues

a proposal for moving this project

hello, guys, this project for a rpc component with jsonrpc, and then we can create more component in this way, such as xmlrpc, pb, grpc, turbo,hprose etc, then we need create many root projects in apache org.

So, I think we need think about moving this project in two ways:

  • move the rpc component to dubbo-rpc module of dubbo project
  • or create a new root project incubator-dubbo-rpc-component, all new rpc component from community will be here.

How about this idea, guys?

support org.apache.dubbo 2.7.x

current version of dubbo-rpc-jsonrpc is write for com.alibaba.dubbo version 2.4.x - 2.6.x

could someone rewrite the code for support org.apache.dubbo 2.7.x

change

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>dubbo</artifactId>
            <version>${dubbo_version}</version>
            <optional>true</optional>
        </dependency>

into

        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo</artifactId>
            <version>${dubbo_version}</version>
            <optional>true</optional>
        </dependency>

and rewrite the JsonRpcProtocol class there is no more com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol

serverlet

作者你好,感谢你回复。
配置感觉我有一步骤不对,
文中说到的:“
注意,如果使用servlet派发请求:

协议的端口必须与servlet容器的端口相同, 协议的上下文路径必须与servlet应用的上下文路径相同。“
这句话怎么理解 以及配置呢,感谢回复谢谢

请问如何在spring boot上配置?

其他没有问题,只有最后一步在web.xml上配转发器的那个不知道怎么配了,spring boot没有web.xml,普通的dubbo协议是通的

关于 跨域支持

想直接将服务抛给 浏览器 里的 JS,需要跨域支持,我试着这么做了

if (request.getMethod().equalsIgnoreCase("OPTIONS")) {
    response.setHeader(CrossOriginFilter.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "*");
    response.setHeader(CrossOriginFilter.ACCESS_CONTROL_ALLOW_METHODS_HEADER, "POST");
    response.setHeader(CrossOriginFilter.ACCESS_CONTROL_ALLOW_HEADERS_HEADER, "Content-Type");
    response.setStatus(200);
} else if (request.getMethod().equalsIgnoreCase("POST")) {
    response.setHeader(CrossOriginFilter.ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "*");
    RpcContext.getContext().setRemoteAddress(request.getRemoteAddr(), request.getRemotePort());
    try {
        skeleton.handle(request.getInputStream(), response.getOutputStream());
    } catch (Throwable e) {
        throw new ServletException(e);
    }
} else {
    response.setStatus(500);
}

是可以的,但是我需要一个开关,可以放到protocol配置里么?像下面(我是用js做ioc启动的)

protocol : {
    type : 'com.alibaba.dubbo.config.ProtocolConfig',
    fields : {
        name : 'jsonrpc',
        port : 9090,
        server : 'jetty',
        cors: true
    }
}

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.