users@glassfish.java.net

Re: Anyway to customize thread pool for MDBs consuming from a JMS Queue?

From: <glassfish_at_javadesktop.org>
Date: Mon, 12 May 2008 07:25:43 PDT

I'm moving my posting from a seperate thread that ended up on the same topic as this...

These settings appear to work, but if I use some logging in the constructors of the message beans, I can some behavior that doesnt seem consistent with the settings.

For example, if I use:

      <bean-pool>
        <steady-pool-size>4</steady-pool-size>
        <resize-quantity>2</resize-quantity>
        <max-pool-size>10</max-pool-size>
        <pool-idle-timeout-in-seconds>60</pool-idle-timeout-in-seconds>
      </bean-pool>

All instances of my application using these settings generally create ~ 20 instances of the message bean (meaning, the Constructor of my message bean class is called 20 times). I don't know how Glassfish internally does its bean caching, so its entirely possible that only 10 MDBs are ever being used simultaneously and roughly 20 are created for faster access, but... If I use:

      <bean-pool>
        <steady-pool-size>1</steady-pool-size>
        <resize-quantity>1</resize-quantity>
        <max-pool-size>1</max-pool-size>
        <pool-idle-timeout-in-seconds>60</pool-idle-timeout-in-seconds>
      </bean-pool>

The constructor is called 101 times (100 messages sent)

This seems counter-intuitive to me... Wouldn't the settings I posted limit Glassfish to instantiating only 1 copy of the MessageBean?
[Message sent by forum member 'asherwin' (asherwin)]

http://forums.java.net/jive/thread.jspa?messageID=273793