Ray
Ray
You can refer to [here](https://github.com/weibocom/motan/blob/master/CHANGELOG.md)
可以通过下面三个方式来控制导出服务所使用的ip: 1. 可以通过`MOTAN_IP_PREFIX`环境变量指定期望使用的ip前缀。比如设置环境变量MOTAN_IP_PREFIX为172.16,则会优先使用172.16开头的ip地址。 2. 可以通过设置服务器的hostname来指定ip。根据你的问题描述,有可能是服务器设置了hostname为10086.cn,所以获取到了这个域名对应的ip。 3. 可以在basicService或者service配置中设置host属性来指定要使用的ip,比如 如果不能调整hostname的话,建议通过设置环境变量方式指定要使用的ip的前缀。 Motan获取本机ip的代码逻辑可以参考[这里](https://github.com/weibocom/motan/blob/aba64c51af0cdb8a167a499c3f9a4fbf3fba9a57/motan-core/src/main/java/com/weibo/api/motan/util/NetUtils.java#L78)
Motan框架并没有对泛化调用做特别支持,上面case中的map方式可以调用成功是hessian2序列化提供的能力。 Motan中的CommonClient的设计意图是方便跨语言调用,其他语言提供的服务在java侧并不会有对应的service,这时就可以使用CommonClient来进行调用。 不同语言间的数据传递主要依赖不同序列化方式。比如使用ProtoBuf或者Breeze序列化 Motan没有支持泛型主要是基于下面考虑: 1. 泛化只能解决简单对象的无依赖调用,实际业务使用的复杂对象很难用泛化来描述 2. 泛化一般与使用的序列化实现相关,泛化能力也很难在多语言中达成能力一致。 3. java的泛化通过反射来实现,对于不需要使用泛化的场景会增加额外的性能开销。 4. 泛化会破坏RPC强契约的形式,容易让client侧和server侧对接口、对象的维护变得困难,除了一些通用服务测试场景外,基本也没有什么使用泛化的场景。而通用测试场景可以通过流量录制回放方式,直接在二进制流方面进行处理,效率比泛化会更高,不过对二次开发能力要求较高。 6. 如果泛化的目的是为了与其他语言交互,建议通过ProtoBuf或者Breeze这些强契约的方式来实现,更适合服务的长期维护。
We will fix this issue in subsequent releases
The relevant [PR](https://github.com/weibocom/motan/pull/1022) has been merged into master and will be released in version 1.2.1 in early March.
@SimonLiuhd Motan version 1.2.1 has been released
目前支持motan2协议的客户端只有java、golang、php、openresty比较成熟,python和c++的客户端实现还不太完善目前只是微博内部使用并没有开源。 如果服务的入参和返回值都是简单对象,可以考虑引入`motan-protocol-restful`模块,同时导出restful协议,client侧使用http进行调用。restful配置可以参考demo模块中的[RestfulServerDemo.java](https://github.com/weibocom/motan/blob/master/motan-demo/motan-demo-server/src/main/java/com/weibo/motan/demo/server/RestfulServerDemo.java)和[motan_demo_server_restful.xml](https://github.com/weibocom/motan/blob/master/motan-demo/motan-demo-server/src/main/resources/motan_demo_server_restful.xml)
Thanks for the feedback. Currently, ConsulRegistry does not support client side subscribing to multiple groups at the same time. It will be supported in subsequent versions.
`com.weibo.api.motan.transport.EndpointFactory: get extension fail. extension name 'motan' not found` means the EndpointFactory SPI extension named "motan" was not found. You can check whether the dependency of the "motan-transport-netty" or "motan-transport-netty4"...
目前不支持SSL。 可以参考[NettyEndpointFactory](https://github.com/weibocom/motan/blob/master/motan-transport-netty4/src/main/java/com/weibo/api/motan/transport/netty4/NettyEndpointFactory.java)实现EndpointFactory扩展点,然后参考NettyServer和NettyClient,修改Bootstrap实现支持SSL的server和client