This discussion is archived
4 Replies Latest reply: Jul 20, 2012 5:29 AM by 950368 RSS

The destination message count limit (maxNumMsgs) of 100000 has been reached

950368 Newbie
Currently Being Moderated
So I seem to be getting this error when trying to send JMS messages in Glassfish to a topic after our application has been up and running for about 18 hours. We're using a topic, so a message is being published to the topic and one of two things should be happening if I understand things correctly: 1) Subscribers on the topic should receive a copy of the message, then the message is deleted from the topic or 2) there are no subscribers so the message doesn't get stored in the topic. However, based on the stack trace below, it is quite clear that the topic queueing up messages. The messages we send are non-persistent and the subscribers are non-durable so if no one is listening to the topic there's no reason to queue up the message. And if someone is listening, when the message is sent to the subscriber then it should be removed from the topic. Maybe I'm not understanding how topics work.

Here's the stack trace:
[#|2012-07-18T08:47:58.976-0400|SEVERE|oracle-glassfish3.1.2|javax.jms.Session.mqjmsra|_ThreadID=47;_ThreadName=Thread-2;|MQJMSRA_DS4001: JMSServiceException on send message:sendMessage: Sending message failed. Connection ID: 5710626523942584577|#]

[#|2012-07-18T08:47:58.976-0400|INFO|oracle-glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=47;_ThreadName=Thread-2;|2012-07-18 08:47:58,976 [Session5710626523942588672] ERROR com.foo.ejb.session.RealtimeCacheEJB$RealtimeCacheResourceChangeListener.onMessage(RealtimeCacheEJB.java:328): Failed to resend the resource change message
javax.jms.JMSException: MQJMSRA_DS4001: JMSServiceException on send message:sendMessage: Sending message failed. Connection ID: 5710626523942584577
                at com.sun.messaging.jms.ra.DirectSession._sendMessage(DirectSession.java:1844)
                at com.sun.messaging.jms.ra.DirectProducer._send(DirectProducer.java:1085)
                at com.sun.messaging.jms.ra.DirectProducer.send(DirectProducer.java:453)
                at com.foo.jms.JMSPublisher.send(JMSPublisher.java:81)
                at com.foo.ejb.session.RealtimeCacheEJB$RealtimeCacheResourceChangeListener.onMessage(RealtimeCacheEJB.java:324)
                at com.sun.messaging.jms.ra.DirectSession._deliverMessage(DirectSession.java:1895)
                at com.sun.messaging.jms.ra.DirectConsumer.deliver(DirectConsumer.java:369)
                at com.sun.messaging.jmq.jmsserver.service.imq.SessionListener.process(IMQDirectService.java:2928)
                at com.sun.messaging.jmq.jmsserver.service.imq.SessionListener.run(IMQDirectService.java:2866)
                at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.messaging.jmq.jmsservice.JMSServiceException: sendMessage: Sending message failed. Connection ID: 5710626523942584577
                at com.sun.messaging.jmq.jmsserver.service.imq.IMQDirectService.sendMessage(IMQDirectService.java:1955)
                at com.sun.messaging.jms.ra.DirectSession._sendMessage(DirectSession.java:1839)
                ... 9 more
Caused by: com.sun.messaging.jmq.jmsserver.util.BrokerException: [B4120]: Can not add message 800910-192.168.21.136(da:25:a2:a:c8:c6)-1-1342615678976 to destination fooRealtimeChange [Topic]. The destination message count limit (maxNumMsgs) of 100000 has been reached.
                at com.sun.messaging.jmq.jmsserver.core.Destination.queueMessage(Destination.java:3202)
                at com.sun.messaging.jmq.jmsserver.core.Destination.queueMessage(Destination.java:3087)
                at com.sun.messaging.jmq.jmsserver.core.Topic.queueMessage(Topic.java:211)
                at com.sun.messaging.jmq.jmsserver.data.handlers.DataHandler.queueMessage(DataHandler.java:440)
                at com.sun.messaging.jmq.jmsserver.data.protocol.ProtocolImpl.processMessage(ProtocolImpl.java:939)
                at com.sun.messaging.jmq.jmsserver.service.imq.IMQDirectService.sendMessage(IMQDirectService.java:1948)
                ... 10 more
Caused by: com.sun.messaging.jmq.util.lists.OutOfLimitsException: Capacity Exceeded was 100001 expected 100000
                at com.sun.messaging.jmq.util.lists.SimpleNFLHashMap.put(SimpleNFLHashMap.java:359)
                at com.sun.messaging.jmq.util.lists.SimpleNFLHashMap.put(SimpleNFLHashMap.java:291)
                at com.sun.messaging.jmq.jmsserver.core.Destination.putMessage(Destination.java:3271)
                at com.sun.messaging.jmq.jmsserver.core.Destination.queueMessage(Destination.java:3137)
                ... 15 more
|#]
  • 1. Re: The destination message count limit (maxNumMsgs) of 100000 has been reached
    ak Explorer
    Currently Being Moderated
    If no consumer on the Topic, the message will not be queued to the destination unless it's sent in a transaction in which case it will be cleaned up when the transaction completes if no consumer at time of transaction commit in GlassFish MQ. You can run 'imqcmd list dst', 'imqcmd query dst', 'imqcmd list dur' and 'imqcmd list txn' to check if any other consumer exist on the Topic that caused the messages get queued or held due to incompleted transaction. If there is a consumer client, make sure it's consuming messages and acknowledge messages if using client ack session.
  • 2. Re: The destination message count limit (maxNumMsgs) of 100000 has been reached
    950368 Newbie
    Currently Being Moderated
    Thanks for the reply. While using imqcmd I noticed the topics limit behavior is set to REJECT_NEWEST. I'm trying to change it to REMOVE_OLDEST but I can't seem to do it. In the glassfish admin console it deals with jms destination resources that will create topics on demand, but I can't seem to have it set the limit behavior. Is there a way to do this? I've been fighting with it for some time now and I'm not getting anywhere. Thanks.
  • 3. Re: The destination message count limit (maxNumMsgs) of 100000 has been reached
    ak Explorer
    Currently Being Moderated
    To change a GlassFish MQ's destination limit behavior, run imqcmd like following, as an exmample which sets the Topic destination 't0' limitBehavior to REMOVE_OLDEST
    imqcmd update dst -t t -n t0 -o limitBehavior=REMOVE_OLDEST
  • 4. Re: The destination message count limit (maxNumMsgs) of 100000 has been reached
    950368 Newbie
    Currently Being Moderated
    Thanks again. While that works, I was hoping that Glassfish could set the limit behaviour automatically when it creates the topic. What you do in Glassfish is create a JMS destination resource. Once that topic/queue has been accessed Glassfish will create it then instead of on start up. However, Glassfish seems to use a set of default property values that I can't seem to override. Anyway, I'll start a new thread in the Glassfish section as you've answered my question. Thanks for the help.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points