Massimo Ugues
Massimo Ugues

Reputation: 4463

How to set max pool size in MDB on weblogic 10.3

I need to set the max pool size on a MDB on weblogic 10.3.

I inserted this annotation on MDB directly

@ActivationConfigProperty(propertyName="MaxPoolSize", propertyValue="1")})

but it seems not to work.

Is there any other option to set?

Upvotes: 4

Views: 4754

Answers (1)

Trent Bartlem
Trent Bartlem

Reputation: 71

Try using weblogic work manager settings to constrain the number of concurrent threads. The max-threads-constraint can be applied to a work manager set up for the specific MDB (or as part of a pool if you apply it to more than one bean)

so, for instance in weblogic-application.xml you'd have

<wls:work-manager>
  <wls:name>MyMDBWorkManager</wls:name>
  <wls:max-threads-constraint-name>MyMDBMaxThreads</wls:max-threads-constraint-name>
</wls:work-manager>

and applied to the beans in weblogic-ejb-jar.xml like so: (this works even when the MDB is annotated)

<wls:weblogic-enterprise-bean>
  <wls:ejb-name>MyMDB</wls:ejb-name>
  <wls:dispatch-policy>MyMDBWorkManager</wls:dispatch-policy>
</wls:weblogic-enterprise-bean>

The 'MyMDBMaxThreads' constraint can be specified in weblogic-application.xml, or directly in the WL Admin Console so it can be tuned on the fly.

Upvotes: 7

Related Questions