weibocom / motan Goto Github PK
View Code? Open in Web Editor NEWA cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
License: Other
A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
License: Other
配置了 accessLog 属性,client 端调用了1000次接口,server端serverserviceStatsLog.log日志是: [motan-totalAccessStatistic] app: motan module: motan total_count: 0 slow_count: 0 biz_excp: 0 other_excp: 0 avg_time: 0.00ms biz_time: 0.00ms avg_tps: 0,为何server,client端的total_count一直是0呢?BUG?
如题
考虑到返回类型为Boolean,修改为下面代码更好:
if (value == null) {
return Boolean.FALSE ;
}
如题,有身份验证机制吗?
Hello,
我在本地Eclipse上运行没有问题,打成架包以后放到linux服务器上运行就报如下错误?是什么问题?
Exception in thread "main" java.lang.NullPointerException
at com.weibo.api.motan.config.handler.SimpleConfigHandler.register(SimpleConfigHandler.java:102)
at com.weibo.api.motan.config.handler.SimpleConfigHandler.export(SimpleConfigHandler.java:77)
at com.weibo.api.motan.config.ServiceConfig.doExport(ServiceConfig.java:211)
at com.weibo.api.motan.config.ServiceConfig.export(ServiceConfig.java:129)
at com.weibo.api.motan.config.springsupport.ServiceConfigBean.onApplicationEvent(ServiceConfigBean.java:90)
at com.weibo.api.motan.config.springsupport.ServiceConfigBean.onApplicationEvent(ServiceConfigBean.java:42)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:333)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:776)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:485)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
在配置的md文件看到motan:method/这个标签,但是demo中的配置文件没有见到用motan:method/这个标签的,RefererConfig中的methods是怎么初始化的?能简单解答一下吗?
版本0.1.0,motan client本身似乎没有使用shutdownhook,在强制关闭client的时候,server会报异常,如下,
09:35:05.232 ERROR [New I/O server worker #1-2] error NettyChannelHandler exceptionCaught: remote=arnes-PC/192.168.232.154:56910 local=/192.168.232.154:38001 event=java.io.IOException: 远程主机强迫关闭了一个现有的连接。
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:321)
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
motan是否有预期增加shutdownhook?或者,我可以如何添加?
Netty 3 is TOO old, we should add a module for netty 4.
感觉相比dubbo更轻量,这点我很喜欢。正好有新项目要上,
刚开始研究motan第二天,提得比较鸡肋的地方请多包涵,能力不够没好意思提pull request。
NettyClient中使用了一个定时器线程扫描所有的异步请求是否超时,可否改用时间轮算法注册回调函数的办法判断超时?修改如下:
- timeMonitorFuture = scheduledExecutor.scheduleWithFixedDelay(
- new TimeoutMonitor("timeout_monitor_" + url.getHost() + "_" + url.getPort()),
- MotanConstants.NETTY_TIMEOUT_TIMER_PERIOD, -MotanConstants.NETTY_TIMEOUT_TIMER_PERIOD,
- TimeUnit.MILLISECONDS);
+ timeWheel = new TimeWheel();
+ timeWheel.begin();
//关闭client
public synchronized void close(int timeout) {
...
- timeMonitorFuture.cancel(true);
+ timeWheel.stop();
...
}
public void registerCallback(final long requestId, final NettyResponseFuture nettyResponseFuture) {
...
this.callbackMap.put(requestId, nettyResponseFuture);
//这里添加超时回调函数
timeWheel.add(nettyResponseFuture.getTimeout(), new TimeWheel.ExpiringHandler() {
@Override
public void onExpire() {
callbackMap.remove(requestId);
nettyResponseFuture.cancel();
}
});
}
//Hash时间轮:
public class TimeWheel implements Runnable {
private int timePointer;
private int maxTTL;
private int tickDuration;
private AtomicBoolean stop = new AtomicBoolean(false);
private ConcurrentHashMap<Integer, Set<ExpiringHandler>> wheel = new ConcurrentHashMap<Integer, Set<ExpiringHandler>>();
public TimeWheel(int tickDuration, int maxTTL) {
this.tickDuration = tickDuration;
this.maxTTL = maxTTL;
}
public TimeWheel() {
this(100, 60 * 60 * 1000);
}
public void begin() {
Executors.newSingleThreadExecutor().execute(this);
}
public void add(int ttl, ExpiringHandler handler) {
if (ttl >= maxTTL)
throw new MotanFrameworkException("Timeout cannot be more than maxTTL.");
if(ttl / tickDuration <= 0)
throw new MotanFrameworkException("Too small ttl.");
int position = (timePointer + ttl / tickDuration * tickDuration) % maxTTL;
wheel.putIfAbsent(position, new ConcurrentHashSet<ExpiringHandler>());
wheel.get(position).add(handler);
}
public void stop() {
stop.getAndSet(true);
}
@Override
public void run() {
while (!stop.get()) {
long c0 = System.currentTimeMillis();
Set<ExpiringHandler> handlers = wheel.remove(timePointer);
if (handlers != null) {
for (ExpiringHandler handler : handlers)
handler.onExpire();
}
if (timePointer + tickDuration > maxTTL)
timePointer = timePointer + tickDuration - maxTTL;
else
timePointer += tickDuration;
long offset = System.currentTimeMillis() - c0;
if (offset > tickDuration)
continue;
try {
Thread.sleep(tickDuration - offset);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public interface ExpiringHandler {
void onExpire();
}
}
如题
我看NettyChannelHandler中有一个processResponse的方法,但是没有找到有处理Response消息的MessageHandler,是没有还是我没找到呢?
访问 http://api.weibo.com/schema/motan 返回 Sorry, that page doesn’t exist!
代码没问题,如RoundRobinLoadBalanceTest里,但是修改为i % 2 !=0更好,把负数情况也考虑在内。
在使用spring-boot运行motan-demo的时候,server的服务无法注册到zookeeper,如下
[zk: localhost:2181(CONNECTED) 27] ls /motan/motan-demo-rpc/com.weibo.motan.demo
.service.MotanDemoService/server
[]
DemoRpcServer的代码改动如下,
package com.weibo.motan.demo.server;
import com.weibo.api.motan.common.MotanConstants;
import com.weibo.api.motan.util.MotanSwitcherUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.HashSet;
import java.util.Set;
@SpringBootApplication
public class DemoRpcServer {
public static void main(String[] args) throws InterruptedException {
SpringApplication app = new SpringApplication(DemoRpcServer.class);
Set<Object> set = new HashSet<Object>();
set.add("classpath*:motan_demo_server.xml");
app.setSources(set);
MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true);
app.run(args);
}
}
pom.xml改动如下,
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.3.3.RELEASE</version>
</dependency>
motan-demo其他代码基本未改动。还是哪里我可能弄错了?不确定这是不是一个问题
按照motan的zookeeper-registry设计:
将一个服务的所有params作为value放在ip节点里(key=ip+port,value=params),这样一次客户端更新会伴随着N+1次zk交互。在大规模部署下,一个核心服务的发版可能会有大量的zk交互流量。预估重启一台Server,所有Client与zk的交互次数=Client数量 * 依赖的Server接口数量 * 当前server数量。比如600台Client_10个接口_40台Server,就是24万次。
当这40台Server完成一轮发布,总共就是24万*40台=960万次。是笔不小的开销。
是否能这样设计:
server在写入params时,对params计算一个hash值,将hash放到key上(ip+port+hash)
当服务变更时,Client的流程:
1.先拉下来servers的所有子节点
2.判断本地缓存是否存在对应的hash,是则直接使用,否则才去取value里的params,并缓存。
这样,除开Client第一次重启,基本可以去掉N+1查询的N。
(dubbo的zk实现是将ip+port+params都作为key,key会很大。这样一次服务变更也会涉及大量冗余数据的传输,也会有问题)
首先非常感谢motan开源,顺便请问一下,看了下demo代码,感觉和dubbo差不多,请问motan和dubbo相比有什么优势?
有没有准备把netty迁移到4.x版本?还有是否可以建立QQ交流群?
如题,motan:service/ 里面自定义的filter属性好像没作用?
filter="com.xxx.filter.MotanFilter"
版本0.1.1的demo中,没有找到一个port对应多个service的注册启动方法.
目前是否支持这个功能? 或后续版本中有没有计划支持这个功能?
12:20:00.989 [main] INFO info - NettyClient finish Open: url=motan://172.13.80.68:8002/com.zdmoney.assets.api.motan.FooService?group=default_rpc
12:20:00.992 [main] INFO info - DefaultRpcReferer node init Success: [DefaultRpcReferer] url=motan://172.13.80.68:8002/com.zdmoney.assets.api.motan.FooService?group=default_rpc
12:20:00.992 [main] INFO info - DefaultRpcProtocol refer Success: url=motan://172.13.80.68:8002/com.zdmoney.assets.api.motan.FooService?group=default_rpc
Exception in thread "main" com.weibo.api.motan.exception.MotanServiceException: error_message: NettyResponseFuture task cancel: serverPort=172.13.80.68:8002 requestId=146147160103200001 interface=com.zdmoney.assets.api.motan.FooService method=hello(java.lang.String) cost=249, status: 503, error_code: 10001,r=
at com.weibo.api.motan.transport.netty.NettyResponseFuture.cancel(NettyResponseFuture.java:151)
at com.weibo.api.motan.transport.netty.NettyClient$TimeoutMonitor.run(NettyClient.java:482)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
12:20:01.397 [main] ERROR error - RefererInvocationHandler invoke Error: uri=motan://172.13.80.68:0/com.zdmoney.assets.api.motan.FooService requestId=146147160103200001 interface=com.zdmoney.assets.api.motan.FooService method=hello(java.lang.String)
com.weibo.api.motan.exception.MotanServiceException: error_message: NettyResponseFuture task cancel: serverPort=172.13.80.68:8002 requestId=146147160103200001 interface=com.zdmoney.assets.api.motan.FooService method=hello(java.lang.String) cost=249, status: 503, error_code: 10001,r=
at com.weibo.api.motan.transport.netty.NettyResponseFuture.cancel(NettyResponseFuture.java:151) ~[motan-transport-netty-0.0.1.jar:na]
at com.weibo.api.motan.transport.netty.NettyClient$TimeoutMonitor.run(NettyClient.java:482) ~[motan-transport-netty-0.0.1.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_25]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[na:1.8.0_25]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_25]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_25]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_25]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
12:20:01.467 [New I/O client worker #1-2] WARN warn - NettyClient has response from server, but resonseFuture not exist, requestId=146147160103200001
motan manager did not support consul registry yet
motan后续计划是什么?是否考虑集成spring cloud相关组件,比如config server, zuul, 以及进一步完善服务治理...
Exception in thread "main" com.weibo.api.motan.exception.MotanServiceException: error_message: NettyResponseFuture task cancel: serverPort=localhost:8002 requestId=146285695919400002 interface=com.huateng.xxx.service.FooService method=hello(java.lang.String) cost=212, status: 503, error_code: 10001,r=
at com.weibo.api.motan.transport.netty.NettyResponseFuture.cancel(NettyResponseFuture.java:151)
at com.weibo.api.motan.transport.netty.NettyClient$TimeoutMonitor.run(NettyClient.java:482)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
从官方提供的手册上来看,这俩框架非常类似,不知道在实现细节上,motan是否有亮点?
版本0.1.0,看目前的文档,motan目前似乎只支持hessian序列化方式,还支持其他序列化方式么?未来有预期增加序列化方式么?如果我要增加一种序列化方式,我可以如何写一些代码来扩展motan?
1.当使用Consul作为注册中心时,如何启用TTL以及如何修改默认group?
2.如何修改默认的group?我尝试做了如下配置:
server:<motan:registry regProtocol="consul" name="consul" address="127.0.0.1:8500?group=testGroup" check="true" /> <motan:service interface="quickstart.FooService" ref="serviceImpl" export="8002" shareChannel="true" group="testGroup"/>
client:<motan:registry regProtocol="consul" name="consul" address="127.0.0.1:8500?group=testGroup"/> <motan:referer id="remoteService" interface="quickstart.FooService" group="testGroup"/>
client堆栈如下:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'remoteService': FactoryBean threw exception on object creation; nested exception is com.weibo.api.motan.exception.MotanFrameworkException: error_message: ClusterSupport No service urls for the refer:motan://172.16.69.17:0/testGroup/quickstart.FooService/1.0/referer, registries:[consul://127.0.0.1:8500/com.weibo.api.motan.registry.RegistryService?group=testGroup], status: 404, error_code: 10101,r=
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1523)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956)
at quickstart.Client.main(Client.java:12)
Caused by: com.weibo.api.motan.exception.MotanFrameworkException: error_message: ClusterSupport No service urls for the refer:motan://172.16.69.17:0/testGroup/quickstart.FooService/1.0/referer, registries:[consul://127.0.0.1:8500/com.weibo.api.motan.registry.RegistryService?group=testGroup], status: 404, error_code: 10101,r=
at com.weibo.api.motan.cluster.support.ClusterSupport.init(ClusterSupport.java:102)
at com.weibo.api.motan.config.handler.SimpleConfigHandler.buildClusterSupport(SimpleConfigHandler.java:55)
at com.weibo.api.motan.config.RefererConfig.createClusterSupport(RefererConfig.java:184)
at com.weibo.api.motan.config.RefererConfig.initRef(RefererConfig.java:128)
at com.weibo.api.motan.config.RefererConfig.getRef(RefererConfig.java:85)
at com.weibo.api.motan.config.springsupport.RefererConfigBean.getObject(RefererConfigBean.java:41)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
... 6 more
ReflectUtil.class
private static final Map<String, Class<?>> name2ClassCache = new HashMap<String, Class<?>>();
...
Class<?> clz = name2ClassCache.get(className);
if (clz != null) {
return clz;
}
clz = forNameWithoutCache(className);
if (clz != null) {
// 应该没有内存消耗过多的可能,除非有些代码很恶心,创建特别多的类
name2ClassCache.put(className, clz);
}
hashmap在多线程并发put/get时应该有问题
你好,
还不是很清楚配置,在IDE中调试demo程序,基于spring配置的demo运行正常:
Hello motan0! Hello motan1! Hello motan2! Hello motan3! Hello motan4! Hello motan5! Hello motan6! Hello motan7!
非spring启动失败,步骤如下:
运行MotanApiExportDemo,启动成功。
运行MotanApiClientDemo,异常堆栈信息:
Exception in thread "main" com.weibo.api.motan.exception.MotanFrameworkException: error_message: ClusterSupport No service urls for the refer:motan://192.168.1.100:0/motan-demo-rpc/com.weibo.motan.demo.service.MotanDemoService/1.0/referer, registries:[local://127.0.0.1:0/com.weibo.api.motan.registry.RegistryService?group=default_rpc], status: 404, error_code: 10101,r=
at com.weibo.api.motan.cluster.support.ClusterSupport.init(ClusterSupport.java:102)
at com.weibo.api.motan.config.handler.SimpleConfigHandler.buildClusterSupport(SimpleConfigHandler.java:52)
at com.weibo.api.motan.config.RefererConfig.createClusterSupport(RefererConfig.java:184)
at com.weibo.api.motan.config.RefererConfig.initRef(RefererConfig.java:128)
at com.weibo.api.motan.config.RefererConfig.getRef(RefererConfig.java:85)
at com.weibo.motan.demo.client.MotanApiClientDemo.main(MotanApiClientDemo.java:49)
定位到ClusterSupport类
throw new MotanFrameworkException(String.format("ClusterSupport No service urls for the refer:%s, registries:%s",
this.url.getIdentity(), registryUrls), MotanErrorMsgConstant.SERVICE_UNFOUND);
猜测是client寻找的服务refer与server注册的服务协议不一致?
希望尽快提供develop guide以便参与维护。
如题
简单看了一下,发现transport层netty版本有点老 还是3.2.5版本
这个后续会有升级么?
Exception in thread "main" com.weibo.api.motan.exception.MotanFrameworkException: error_message: register error! Could not find extension for registry protocol:zookeeper, make sure registry module for zookeeper is in classpath!, status: 500, error_code: 20008,r=
这是什么原因?
您好,如题,以后会支持Server端用java开始,client端用php调用吗?
RT, Thx!
while块加上非空条件避免出现空指针异常
运行motan-demo的motan-demo-client中的DemoRpcClient,spring装配,zookeeper注册中心,motan版本0.1.0,报错如下,
Connected to the target VM, address: '127.0.0.1:49527', transport: 'socket'
Disconnected from the target VM, address: '127.0.0.1:49527', transport: 'socket'
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'motanDemoReferer': FactoryBean threw exception on object creation; nested exception is com.weibo.api.motan.exception.MotanFrameworkException: error_message: Create registry false for url:zookeeper://127.0.0.1:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc, status: 503, error_code: 20004,r=
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1585)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1051)
at com.weibo.motan.demo.client.DemoRpcClient.main(DemoRpcClient.java:29)
Caused by: com.weibo.api.motan.exception.MotanFrameworkException: error_message: Create registry false for url:zookeeper://127.0.0.1:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc, status: 503, error_code: 20004,r=
at com.weibo.api.motan.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:63)
at com.weibo.api.motan.cluster.support.ClusterSupport.getRegistry(ClusterSupport.java:129)
at com.weibo.api.motan.cluster.support.ClusterSupport.init(ClusterSupport.java:89)
at com.weibo.api.motan.config.handler.SimpleConfigHandler.buildClusterSupport(SimpleConfigHandler.java:52)
at com.weibo.api.motan.config.RefererConfig.createClusterSupport(RefererConfig.java:184)
at com.weibo.api.motan.config.RefererConfig.initRef(RefererConfig.java:128)
at com.weibo.api.motan.config.RefererConfig.getRef(RefererConfig.java:85)
at com.weibo.api.motan.config.springsupport.RefererConfigBean.getObject(RefererConfigBean.java:41)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
... 6 more
Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 200
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:880)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:98)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:92)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:80)
at com.weibo.api.motan.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:44)
at com.weibo.api.motan.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:56)
... 14 more
但是,motan-demo-server没有报错,是不是我哪里配错了?或者是环境问题?
您好,
想在现有的SSH项目中加入motan,对外提供RPC接口
如何在SSH项目中配置呢?
web.xml怎么配置?
加载xml的时候为什么会报 Caused by: java.io.FileNotFoundException: http://api.weibo.com/schema/motan.xsd ?是我配置的问题么
期待
如:ExtensionLoader getSingletonInstance方法里 synchronized (singletonInstances):
findbugs提示This method performs synchronization an object that is an instance of a class from the java.util.concurrent package (or its subclasses). Instances of these classes have their own concurrency control mechanisms that are orthogonal to the synchronization provided by the Java keyword synchronized. For example, synchronizing on an AtomicBoolean will not prevent other threads from modifying the AtomicBoolean.
虽然没什么问题,建议把synchronized 块重构为synchronized 方法。
Such as the title.
If it can, how to use it?
Yar is a widely used php rpc framework. We could implement the protocol of yar to support cross-language invocation.
There might be three steps:
We need a listener to start/stop zk client when heartbeat switcher is changed. Consul registry is implemented in a different way, it should be fixed too.
运维及监控 和管理什么时候有文档出来 这些没有的话 不敢上生产啊
该wiki中(https://github.com/weibocom/motan/wiki/zh_userguide ) 对basicService的配置说明如下:
使用basicService简化配置
<motan:basicService .../>
rpc服务的通用配置,用于配置所有服务接口的公共配置,减少配置冗余。basicService包含以下常用属性:
id:标识配置项
export:标识服务的暴露方式,格式为“protocolId:port”(使用的协议及对外提供的端口号),其中protocolId:应与motan:protocol中的name对应
group:标识服务的分组
module:标识模块信息
protocol:标识service使用的协议,与motan:protocol中的name对应,默认为motan协议
registry:标识service使用的注册中心,与motan:registry中的name对应
但在 http://api.weibo.com/schema/motan.xsd 中,未见basicService内有protocol。(导致IDE配置protocol时会报错)
你好,
根据motan-demo/demo_guide.md的说明,在motan-demo下执行 mvn clean package
之后,motan-demo-xxx/target/目录中并没有生成xxx.tar.gz的文件
我看了pom.xml之后发现除了需要执行mvn clean package,还需要进入子模块目录执行 mvn assembly:single
才会生成xxx.tar.gz。
但是tar.gz的压缩包解压之后,没有bin目录,查看motan-demo-server/src/main/assembly/assembly.xml文件,${project.basedir}/src/main/bin,貌似代码中并没有这个目录。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.