0 Replies Latest reply on Mar 13, 2013 6:24 AM by Stuart Williamson

    MaxPoolSize not respected after exception thrown by MDB

    Stuart Williamson Novice

      We have encountered an issue where the MaxPoolSize setting on our MDB does not appear to be respected after an exception is encountered. In our application we have set the MaxPoolSize to 1 using the @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=1) annotation with AOP. Initially this behaves as expected and everything is processed in a single thread, however, after an exception is encountered the number of threads doubles. Interstingly, if we include the @org.jboss.ejb3.annotation.DefaultActivationSpecs ({@javax.ejb.ActivationConfigProperty(propertyName = "maxSession", propertyValue = "1")}) annotation, everything behaves as expected.


      I have attached a sample application that shows this behaviour, it can be deployed in the default node as follows:

      • Deploy hello-world-ejb.jar, scratchpad-aop.xml and scratchpad-destination-service.xml
      • Modify JBOSS_HOME in mdb.bat to point to a suitable JBoss installation
      • Run mdb.bat

      The sample client application simply places 15 text messages (containing sequential numbers) on a queue. There is then an MDB that debugs the value obtained from the queue 3 times, with a short delay between each debug statement, then throws an EJBException to force the issue. The log shows that the first message is processed in isolation, then the second and third messages are processed in parallel, etc.