activeMq与spring、dubbo整合报错RpcException/TimeoutException

来源:互联网 发布:淘宝网整理箱 编辑:程序博客网 时间:2024/06/07 02:08

activeMq和spring的配置可参考http://blog.csdn.net/jiuqiyuliang/article/details/48758203,向队列发送消息报错RpcException和TimeoutException,报错信息为:
Failed to invoke the method defaultSendMessage in the service com.csair.test.user.service.MqService. Tried 3 times of the providers [10.95.58.137:20880] (1/1) from the registry 127.0.0.1:2181 on the consumer 10.95.58.137 using the dubbo version 2.4.9. Last error is: Invoke remote method timeout. method: defaultSendMessage, provider: dubbo://10.95.58.137:20880/com.csair.test.user.service.MqService?accepts=2000&anyhost=true&application=user-test-service-consumer-app&check=false&dubbo=2.4.9&interface=com.csair.test.user.service.MqService&methods=sendMessageToDest,defaultSendMessage,receive&pid=4640&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1507509058403, cause: Waiting server-side response timeout. start time: 2017-10-09 08:32:10.499, end time: 2017-10-09 08:32:11.502, client elapsed: 1 ms, server elapsed: 1002 ms, timeout: 1000 ms, request: Request [id=11, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=defaultSendMessage, parameterTypes=[class java.lang.String], arguments=[testMq], attachments={path=com.csair.test.user.service.MqService, interface=com.csair.test.user.service.MqService, version=0.0.0}]], channel: /10.95.58.137:50025 -> /10.95.58.137:20880
at
Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan timer.
其他的dubbo服务正常,按照网上的说法,对这个mq的service设置超时时间即可,可能因为mq发送消息耗时较长,provider.xml改为

<dubbo:service interface="com.csair.test.user.service.MqService" ref="mqService" timeout="120000"/>