users@glassfish.java.net

Re: Limit MDB thread pool

From: Gavilan <gavilancomun_at_gmail.com>
Date: Thu, 04 Dec 2008 13:42:36 +0000

glassfish_at_javadesktop.org wrote:
> We have a process that sends about 200 messages to the IMQ queue at one time.
> The MDB seems to spawn a lot of threads and tries to process many of
these concurrently.
> Processing each message takes a lot of resources and I think it would
be better
> if we limit the MDB to only process 5-10 at a time. Is there a way
to configure this?

I use an activation property in the MDB annotation:

@MessageDriven(mappedName = "MyQueue1",
   activationConfig = {
   @ActivationConfigProperty(propertyName = "endpointPoolMaxSize",
     propertyValue = "10")
})

Best Wishes,
James