Single Threaded MDB on Glassfish

橙三吉。 提交于 2019-12-01 07:28:09

问题


I have a number of MDBs running on Glassfish 3.1.2.2. Due to the nature of work on one of the MDBs I need to make it single threaded. I looked at the Tuning Guide, and while setting the maximum pool size to 1 does resolve the problem, it also means all the other MDBs are single threaded. What I'd really like to do achieve is for the specific MDB to be single threaded, whilst allowing the others to be multi-threaded.


回答1:


That's easy to achieve via the 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 above section will limit the number of processing beans to strictly 1, regardless of what the global poolsize says. That way you can easily finetune the system setup.



来源:https://stackoverflow.com/questions/20471726/single-threaded-mdb-on-glassfish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!