【问题标题】:Connection Failure Using Spring-JMS DefaultMessageListenerContainer cacheLevelName CACHE_NONE使用 Spring-JMS DefaultMessageListenerContainer cacheLevelName CACHE_NONE 连接失败
【发布时间】:2012-05-19 01:56:42
【问题描述】:

我将 Spring-JMS DefaultMessageListenerContainer 实现更改为使用 CACHE_NONE 的 cacheLevelName 并遇到以下异常。更改概述了here。我正在使用 glassfish v 2.1、Open MQ 4.4 和 Spring 3.*。关于我可能出错的地方有什么想法吗?

网络应用日志:

[#|2012-05-16T21:18:12.620+0000|SEVERE|sun-appserver9.1|javax.resourceadapter.mqjmsra.outbound.connection|_ThreadID=284;_ThreadName=updateJmsContainer-90;_RequestID=3aa71c9e- 3ac0-4142-b914-ffbdc6e6bb37;|MQJMSRA_MC4001:构造函数:Aborting:JMSException on createConnection=[C4000]:数据包确认失败。用户=管理员,代理=本地主机:45088(55601)|#]

2012-05-16 21:18:17,636 [updateJmsContainer-90] 警告 org.springframework.jms.listener.DefaultMessageListenerContainer - 目标“TestQ”的 JMS 消息侦听器调用程序设置失败 - 试图恢复。原因:MQRA:CFA:allocation failure:createConnection:Error in allocating a connection。原因:MQJMSRA_MC4001:构造函数:Aborting:JMSException on createConnection=[C4000]:数据包确认失败。用户=管理员,经纪人=本地主机:45088(55601)

代理日志文件:

[16/May/2012:21:10:14 UTC] [B1039]: Broker "appbroker@host:45028" ready.
[16/May/2012:21:10:41 UTC] [B1065]: Accepting: guest@206.220.220.111:56811->jms:55601. Count: service=1 broker=1
[16/May/2012:21:10:48 UTC] [B1065]: Accepting: guest@206.220.220.111:25432->jms:55601. Count: service=2 broker=2
[16/May/2012:21:10:55 UTC] [B1065]: Accepting: guest@206.220.220.111:25478->jms:55601. Count: service=3 broker=3
[16/May/2012:21:11:56 UTC] [B1065]: Accepting: guest@206.220.220.73:44040->jms:55601. Count: service=4 broker=4
[16/May/2012:21:11:56 UTC] [B1065]: Accepting: guest@206.220.219.227:33237->jms:55601. Count: service=5 broker=5
...
...
[16/May/2012:21:17:50 UTC] [B1065]: Accepting: admin@127.0.0.1:46564->jms:55601. Count: service=500 broker=500

[16/May/2012:21:17:50 UTC] WARNING [B3004]: **No threads are available to process a new connection on service jms. 1000 threads out of a maximum of 1000 threads are already in use by other connections.** A minimum of 2 threads must be available to process the connection. Please either limit the # of connections or increase the imq.<service>.max_threads property. Closing the new connection.
[16/May/2012:21:18:01 UTC] [B1066]:   Closing: ???@127.0.0.1:0->jms:0 because "[B3004]: No threads are available to process a new connection on service jms. 1000 threads out of a maximum of 1000 threads are already in use by other connections. A minimum of 2 threads must be available to process the connection. Please either limit the # of connections or increase the imq.<service>.max_threads property. Closing the new connection. ". Count: service=0 broker=500
[16/May/2012:21:18:01 UTC] WARNING Problem detected while attempting to send notification mq.connection.close from MBean Service Monitor
[16/May/2012:21:18:01 UTC] WARNING Cannot determine service name from connection ID: 7881641671884329217

【问题讨论】:

    标签: spring jms spring-jms


    【解决方案1】:

    此 C4000 错误是网络通用异常处理程序。这可能是缓存级别更改的结果。应用程序可能会打开太多与服务器的连接,具体取决于您的池设置,并且服务器可能缺乏管理它们的资源 - 最好的猜测可能是内存。

    请检查您的 OpenMQ 服务器日志文件和内存使用情况。

    消费者和 MQ 服务器之间是否有任何网络配置(防火墙、QoS 路由器...)可以控制连接建立?快速打开许多连接可能被视为 SYN 泛洪,这是一种常见的 DoS 攻击。

    【讨论】:

    • 我在上面添加了我的代理日志文件,它似乎达到了最大线程数(1000)。增加 imq..max_threads 属性是这里的真正解决方案还是其他错误?代理启动脚本上的内存设置是“-Xmx3048m -Xincgc”&感谢大家的帮助!
    • 真正的问题是:你真的需要同时准备这么多连接/消费者吗?
    • 我可以降低最大池大小并尝试。由于某种原因,我的测试服务器上的设置仅转到 124,即 [B1065]: Accepting: admin@206.220.219.238:47378->jms:35425。 Count: service=124 broker=124 并且没有最大线程问题,而生产达到 500,即 Count: service=500 broker=500。两者的池设置完全相同,所以我有点恼火......发送到队列的消息在负载方面非常接近。
    • 你真的有足够的资源让 500 个消费者可以同时处理 500 条消息(CPU 和内存)吗?您应该使用较少的消费者进行基准测试(例如,如果您有 16 个内核,则为 20 个)以找到最佳并行化选项以获得最佳吞吐量...
    • 是的,可能已经够远了。
    猜你喜欢
    • 2021-04-01
    • 2021-06-16
    • 2021-03-21
    • 1970-01-01
    • 2021-11-10
    • 2017-11-07
    • 2013-03-14
    • 2017-08-20
    • 2017-11-08
    相关资源
    最近更新 更多