users@glassfish.java.net

[gf-users] MDB Problems

From: Ryan Cuprak <rcuprak_at_gmail.com>
Date: Mon, 22 Feb 2016 08:55:49 -0500

Hello,
 I am seeing two unexpected behaviors with MDBs in GlassFish 4 (tested in Payara too):
Zombie Beans
Pooling problems

With my problems, GlassFish is configured to use ActiveMQ as its queuing system.

 With the zombie beans, if an EJB Exception (or any runtime exception) is thrown by an MDB, the following happens:
The beans never processes another message (expected this - but wouldn’t have expected it to hang around dead in the pool)
Sticks around and isn’t garbage collected or apparently released from the pool (determined via heap dumps)
Message ends up stuck in the queue (ActiveMQ will only try redelivering after GlassFish is terminated)
If there are 10 beans in the MDB pool, once ten messages fail, GF never processes any more messages.

 With pooling problems:
I configured the MDB pool size to a max of 30
Only seeing 15 MDBs being created ever (even if the queue has thousands of messages)
10 of the MDB instances process messages, the other 5 do nothing

 I have recreated both of these outside of my app using a simple test app with a single MDB.

 Any suggestions?

-Ryan