For my web app, I have a JMS topic which is receiving many messages at any given time. I have a MDB that processes the messages and updates the database based on the message data. I had been getting org.hibernate.exception.LockAcquisitionException
when the topic was receiving multiple messages all at the same time so I changed the maxSessions attribute for the MDB to 1 and made it a singleton.
Now I am not seeing the Hibernate exceptions anymore, but I have concerns about performance. How large can I expect the Topic to get before I start seeing problems? I am using JBoss 4.3 EAP and I tried searching for how to configure this but nothing turned up. Will the topic size grow until Java runs out of memory or is this something that can be configured in JBoss?
By default, JBoss Messaging will store its messages in an embedded Hypersonic database. If your topic starts filling up, your memory consumption shouldn't increase linearly, but sooner or later the database will fill up (from what I recall, Hypersonic has a 40,000 row limit, in this configuration at least).
More generally, if you're producing messages faster than you're consuming them, then you have a problem. You either need to produce them more slowly, consumer them more quickly, or work out a way of discarding messages.