Ray

Results 188 comments of Ray

感谢指正,后续版本会增加对netty channel的connected判断

可以确认一下 1、是否初始化了com.weibo.api.motan.config.springsupport.AnnotationBean(@Bean注解或者xml配置方式) 2、AnnotationBean要扫描的package是否设置正确。 建议debug AnnotationBean的postProcessBeforeInitialization方法,先确认AnnotationBean是否正确初始化,然后在确认设置的@motanreferer的bean是否进行了处理,是否处理中发生异常。

@dcstrong 目前的注解只获取直接声明的feild上的注解,不处理父类的feild。我们会在后续版本中增加对父类feild的处理。 你可以试试把@MotanReferer的注解加在对应的setter方法上,看能不能解决

近期没有支持nodejs的计划,欢迎社区贡献nodejs的版本:)

打包成一个独立的fatjar时,spi扩展声明文件需要使用追加模式,可以参考下面这样 org.apache.maven.plugins maven-shade-plugin 2.3 package shade META-INF/spring.schemas META-INF/spring.handlers META-INF/services/com.weibo.api.motan.registry.Registry META-INF/services/com.weibo.api.motan.registry.RegistryFactory META-INF/services/com.weibo.api.motan.rpc.Protocol META-INF/services/com.weibo.api.motan.cluster.LoadBalance META-INF/services/com.weibo.api.motan.cluster.Cluster META-INF/services/com.weibo.api.motan.codec.Codec *:* META-INF/*.SF META-INF/*.DSA META-INF/*.RSA

@aqiangsoft NettyServerChannelManage的主要作用是限制最大建链数量,register的更适合做建链入口管理。

这是hessian的一个bug,解决方法可以参考https://github.com/weibocom/motan/issues/127 也可以使用[breeze](https://github.com/weibreeze/breeze/wiki/zh_overview)(motan1.1.7之后版本支持)或者hprose序列化来代替。

CommonHandler的设计目的其实是支持跨语言无schema时的调用,通过CommonHandler可以直接拿到response,也不是必须要使用对象调用的。 这块我们的想法比较简单,对于普通用户,要求服务使用强类型的限制;对于二次开发,比如代理,能够获取到底层response,就已经可以做很多事了,所有没有做进一步封装。

@gavenwangcn 感谢反馈,我们会考虑在后续版本中增强这块的能力。 当前版本在motan2协议+breeze序列化的基础上,可以实现不依赖pojo对象的泛化调用。可以在demo中试试下面代码。 首先需要在`motan2_demo_client.xml`中指定使用breeze序列化。 ```xml ``` 然后使用下面代码进行泛化调用 ```java import com.weibo.breeze.message.GenericMessage; import com.weibo.breeze.serializer.CommonSerializer; // common client CommonHandler xmlClient = (CommonHandler) ctx.getBean("motanDemoReferer-common-client"); int nameIndex = CommonSerializer.getHash("name"); //没有breeze schema的对象,需要计算index;有schema的对象,直接使用schema中的index int idIndex = CommonSerializer.getHash("id");...

motan的超时设置是针对服务或者方法的,无法针对单个请求定义超时时间。 如果要自己实现的话,会比较麻烦。需要修改NettyChannel,在发送请求时根据service名和retry信息,按自定义配置(例如从properties中获取)修改超时时间。可以使用[spi扩展机制](https://github.com/weibocom/motan/wiki/zh_developguide#扩展机制)实现EndpointFactory扩展点。实现方式可以参考motan的netty模块或者netty4模块