如何设置队列生产者超时? [英] How to set a queue producer timeout?

查看:167
本文介绍了如何设置队列生产者超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试WebLogic 10.3.1 JMS,但是有问题.

I am testing WebLogic 10.3.1 JMS, but there has a problem.

我的测试步骤:

  1. 启动WebLogic Server
  2. 启动JMS客户端
  3. 客户端将对象发送到WebLogic JMS,服务器接收到该对象.
  4. 停止WebLogic Server
  5. 将另一个对象发送到WebLogic JMS.

我希望这是一个异常,但是没有出现任何异常,程序已挂起.程序在以下位置停止:

What I expect is a exception come out, but there have not anything appear and program hanged. Program stopped at:

sender.send(objMsg);

我已经添加了一些超时设置,但是仍然无法正常工作:

I have add some timeout settings, but still not working:

((WLProducerImpl) sender).setSendTimeout(1000);
((WLConnection) connection).setReconnectPolicy(JMSConstants.RECONNECT_POLICY_PRODUCER);
((WLConnection) connection).setReconnectBlockingMillis(1000);

在这种情况下,有什么方法可以产生异常?非常感谢.

Is there any way to produce exception in this case? Thank You Very Much.

最好的问候, 克里斯

推荐答案

找到的解决方案:

请添加以下两个参数:

-Dsun.net.client.defaultConnectTimeout=30000
-Dsun.net.client.defaultReadTimeout=30000

这篇关于如何设置队列生产者超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆