问题:

 

Caused by: com.sun.messaging.jms.MQRuntimeException: MQJMSRA_DS4001: JMSServiceException on send message:sendMessage: Sending message failed. Connection ID: 514344369131286016 Caused by:com.sun.messaging.jmq.jmsserver.util.BrokerException: [B4403]: Exception on processing produced message PacketReference[4004-192.168.31.232(f8:1c:d9:24:de:b9)-1-1449460088813][TID=514344369256300544, null]: [B4303]: The maximum number of messages [1,000] that the producer can process in a single transaction (TID=514344369256300544) has been exceeded. Please either limit the # of messages per transaction or increase the imq.transaction.producer.maxNumMsgs property.

 

 

解决:

原来使用的是JMSContext ,改为使用 connectionFactory 创建不带transaction的session

JMSContext 在ejb中是transaction 的,所以循环中一万条消息都在一个事务中,我们的业务场景是没必要使用transaction的

 

发表评论

电子邮件地址不会被公开。