Singlemode MDB on Glassfish

I have several MDBs running on Glassfish 3.1.2.2. Due to the nature of the work on one of the MDBs, I need to make it single-threaded. I looked through the Setup Guide , and setting the maximum pool size to 1 solves the problem, it also means that all other MDBs are single-threaded, What I really would like to achieve is that a specific MDB should be single-threaded, while while others may be multithreaded.

+2
source share
1 answer

This is easily achieved using glassfish-ejb-jar.xml deployment descriptor:

<glassfish-ejb-jar> <enterprise-beans> <ejb> <ejb-name>YourMDB</ejb-name> <bean-pool> <resize-quantity>1</resize-quantity> <max-pool-size>1</max-pool-size> <steady-pool-size>1</steady-pool-size> </bean-pool> </ejb> </enterprise-beans> </glassfish-ejb-jar> 

The section above will limit the number of beans processed strictly to 1, regardless of what the global pool says. Thus, you can easily configure the system.

+2
source

Source: https://habr.com/ru/post/1340388/


All Articles