Giter Club home page Giter Club logo

Comments (6)

rayzhang0603 avatar rayzhang0603 commented on August 22, 2024 1

export="demoRest:8082,demoMotan:8805"这里指明了用什么协议在什么端口对外提供服务。其中的demoRest和demoMotan都是protocol bean的id。

restful场景中使用的是demoRest的protocol配置,所以需要在demoRest中设置相关参数。

demoMotan中配置的参数,只会在motan协议中生效的。

from motan.

rayzhang0603 avatar rayzhang0603 commented on August 22, 2024

可以通过设置motan:protocol配置中的maxContentLength来设置最大运行请求大小。比如demo中部分server配置就设置了这个参数.

这个配置项在restful协议中是在这里生效的。

from motan.

pitli avatar pitli commented on August 22, 2024

@rayzhang0603

<motan:protocol id="demoRest" name="restful" endpointFactory="netty"/>

<motan:protocol id="demoMotan" name="motan" default="true" maxServerConnection="80000"
				maxContentLength="52428800" payload="52428800"
				maxWorkerThread="800" minWorkerThread="20"/>

<!-- 同时提供restful协议和motan协议 -->
<motan:basicService export="demoRest:8082,demoMotan:8805"
                    group="motan-demo-rpc" accessLog="false" shareChannel="true" module="motan-demo-rpc"
                    application="myMotanDemo" registry="registry" id="serviceBasicConfig"/>

这是我的motan-server.xml配置,这里已经配置了的,但是并不会生效。在解析motan:protocol标签时并不会进入这里,只有在解析motan:basicService标签时才会进入,但是这个标签没有maxContentLength这个参数的。

from motan.

pitli avatar pitli commented on August 22, 2024

@rayzhang0603
0T`(PGH4EO2TCDVC{7YH{9M
这是我在启动后断点进入的截图,只有motan:basicService中的参数进入到这个工厂类中进行初始化了。

from motan.

rayzhang0603 avatar rayzhang0603 commented on August 22, 2024

url会分别从protocol、basicService、service配置中合并参数的。把maxContentLength加到demoRest这个protocol中试一下,这个protocol才是对restful协议的配置。

<motan:protocol id="demoRest" name="restful" endpointFactory="netty" maxContentLength="52428800"/>

<motan:protocol id="demoMotan" name="motan" default="true" maxServerConnection="80000"
				maxContentLength="52428800" payload="52428800"
				maxWorkerThread="800" minWorkerThread="20"/>

<!-- 同时提供restful协议和motan协议 -->
<motan:basicService export="demoRest:8082,demoMotan:8805"
                    group="motan-demo-rpc" accessLog="false" shareChannel="true" module="motan-demo-rpc"
                    application="myMotanDemo" registry="registry" id="serviceBasicConfig"/>

from motan.

pitli avatar pitli commented on August 22, 2024

按照这个配置可以正常修改maxRequestSize,非常感谢@rayzhang0603。但我还有个问题,看xml中都是protocol配置,原代码中也没有找到哪里会进行区分啊,为什么加在id为demoMotan的protocol中会起不到作用呢。

from motan.

Related Issues (20)

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.