问题
I am testing WebLogic 10.3.1 JMS, but there has a problem.
My Testing step:
- Start WebLogic Server
- Start JMS Client
- Client send a object to WebLogic JMS and server received the object.
- Stop WebLogic Server
- Send another object to 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.
Best Regards, Chris
回答1:
You can try putting timeout in send method. something similar to following: sender.send(objMsg, Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, 10000);
回答2:
I suspect the WebLogic transport is hung and hasn't detected the server has gone - and the send is blocked in the transport. Unless WebLogic JMS are using a separate thread internally, there's no a timeout will help.
IMHO, WebLogic support are the only guys who'll be able to help you on this one (looks like a bug).
回答3:
Solution Found:
Please add these 2 parameters:
-Dsun.net.client.defaultConnectTimeout=30000
-Dsun.net.client.defaultReadTimeout=30000
来源:https://stackoverflow.com/questions/1872894/how-to-set-a-queue-producer-timeout