2

I would like to configure the pool size of a MDB but just one. I deploy my application on JBOSS 6 or Glassfish 3 so the solution must be standard.

I found for JBOSS maxSession for @ActivationConfigProperty but it is not standard For glassfish i don't find anything to create sun-ejb-jar.xml ...

Can you help me ? thanks.

Pindi
  • 23
  • 1
  • 3
  • Possible duplicate of http://stackoverflow.com/questions/5046852/how-to-restrict-pool-size-of-mdb-on-glassfish-v3 – Raedwald Mar 07 '12 at 17:06
  • Related question: http://stackoverflow.com/questions/20471726/single-threaded-mdb-on-glassfish – dedek Oct 04 '14 at 19:57

3 Answers3

3

For glassfish, you can specify bean's max-pool-size to 1 in glassfish-ejb-jar.xml. See deployment guide.

pdudits
  • 896
  • 6
  • 9
1

You'll need a sun-ejb-jar.xm which goes in the META-INF folder.

Here's one that you can use / edit.

<sun-ejb-jar>
    <enterprise-beans>
        <unique-id>0</unique-id>
        <ejb>
            <ejb-name>YOUR EJB NANME</ejb-name>
            <jndi-name>YOUR JNDI NAME</jndi-name>
            <bean-pool>
                <steady-pool-size>1</steady-pool-size>
                <resize-quantity>1</resize-quantity>
                <max-pool-size>3</max-pool-size>
                <pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
            </bean-pool>
        </ejb>
    </enterprise-beans>
</sun-ejb-jar>
Preston
  • 3,273
  • 4
  • 26
  • 35
  • I have created glassfish-ejb-jar.xml some your sun-ejb-jar.xml which goes in WEB-INF of my war with web.xml,glassfish-web.xml and everything works ! thank you ! Now i need to configure jboss 6. I have customized ejb3-interceptors-jar.xml with ` @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=1, timeout=200000) `but i have an exception : `EJBException: Failed to acquire the pool semaphore, strictTimeout=200000` whereas my mdb run in less than 30000ms i would like the same behavior as `@ActivationConfigProperty` with `maxSession` – Pindi Dec 28 '11 at 09:39
0

This is not settable through standard Java EE 6 activation config properties, which are:

  • acknowledgeMode,
  • messageSelector,
  • subscriptionDurability,
  • destinationType.

All others are provider-specific.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
MaDa
  • 10,511
  • 9
  • 46
  • 84