Comments (6)
export="demoRest:8082,demoMotan:8805"
这里指明了用什么协议在什么端口对外提供服务。其中的demoRest和demoMotan都是protocol bean的id。
restful场景中使用的是demoRest
的protocol配置,所以需要在demoRest
中设置相关参数。
demoMotan
中配置的参数,只会在motan协议中生效的。
from motan.
可以通过设置motan:protocol配置中的maxContentLength
来设置最大运行请求大小。比如demo中部分server配置就设置了这个参数.
这个配置项在restful协议中是在这里生效的。
from motan.
<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.
@rayzhang0603
这是我在启动后断点进入的截图,只有motan:basicService中的参数进入到这个工厂类中进行初始化了。
from motan.
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.
按照这个配置可以正常修改maxRequestSize,非常感谢@rayzhang0603。但我还有个问题,看xml中都是protocol配置,原代码中也没有找到哪里会进行区分啊,为什么加在id为demoMotan的protocol中会起不到作用呢。
from motan.
Related Issues (20)
- How to initilaze motan RPC client lazily? HOT 1
- protocol's lazyInit attribute does not take effect under motan-transport-netty4 HOT 5
- 长时间不请求就出现getChannel Error HOT 2
- zookeeper版本能否升级下
- 流量切换异常 HOT 4
- RCE Vulnerability
- RCE Vulnerability HOT 1
- Motan能支持跨线程传递上线文吗 HOT 1
- A new RCE Vulnerability HOT 3
- rpc服务启动后注册到zk里面的ip地址不是当前应用服务器的内网ip HOT 1
- motan泛化调用不支持List<T>类型 HOT 2
- endpoints心跳检查,校验节点是否存活的逻辑是不是存在问题 HOT 5
- 我现在有一个大语言的模型,只支持Python,但是我目前的服务是Java项目,Java项目的服务调用使用的motan,请问Python支持motan吗?或者有没有什么其他好的建议可以提供一下 HOT 1
- where can we get the release notes HOT 1
- [bug] ConsulRegistry.serviceListener HOT 1
- [Bug] 在这个方法中 ClusterSupport.doRefreshReferersByUrls HOT 1
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'motanMicrosoftEmailServiceImpl' defined in file [E:\2.0\microsoftEmail\target\classes\com\example\microsoftemail\rpc\MotanMicrosoftEmailServiceImpl.class]: Initialization of bean failed; nested exception is com.weibo.api.motan.exception.MotanFrameworkException: error_message: com.weibo.api.motan.transport.EndpointFactory: get extension fail. extension name 'motan' not found, status: 503, error_code: 20001,r=null HOT 2
- Does motan RPC support SSL HOT 2
- DefaultResponseFuture#getValueOrThrowable抛出MotanServiceException HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from motan.