geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aman Nanner/MxI Technologies <>
Subject Re: Sharing resources in an MDB
Date Fri, 27 Apr 2007 04:24:19 GMT
I tried using Active MQ message groups, but that solution does not work
because the MDB itself is not the consumer for the JMS resource; rather,
there is a single MessageEndpointProxy class that is the message listener.
The message is distributed to MDBs later in the chain.

             David Jencks                                                  
   >                                                    To 
             04-25-2007 11:35                                           cc 
                                       Re: Sharing resources in an MDB     
             Please respond to                                             

On Apr 25, 2007, at 8:14 AM, ananner wrote:

> I also have a requirement to limit a certain MDB to a maximum of one
> instance, but I am a bit confused as to your response.  Are you
> saying that
> I should put a pool size limit on the <outbound-resourceadapter> which
> defines the Connection Factory that my MDB subscribes to?

The ResourceAdapter instance gets a BootstrapContext instance when
its started, and the BootstrapContext basically includes a thread
pool.  So if you give it a thread pool with only one thread....

In geronimo you specify which thread pool to use with this part:


So you could include a thread pool:

     <gbean name="SingleThreadPool"
         <attribute name="keepAliveTime">5000</attribute>
         <attribute name="poolSize">1</attribute>
         <attribute name="poolName"> SingleThreadPool </attribute>

and use it:


This is a horrible solution because you have to set up a resource
adapter instance for each mdb that needs its size limited in this
way.  Hopefully there's a way to restrict the mdb pool size that I
don't know about.

BTW, I recall hearing James Strachan talk about message groups.  If
your requirements are that you get sets of messages that, within the
set, must be processed in order rather than all messages must be
processed in order you might be able to introduce some concurrency by
using message groups.

Hope this helps
david jencks

> Thanks,
> Aman
> djencks wrote:
>> It might possibly work for activemq if you don't use any
>> transactions, but if you use transactions I would expect it to
>> completely break and give pretty random behavior.  I don't think
>> there's any reason to expect it to work even without transactions.
>> I have trouble keeping all the places you can configure sizes
>> straight, but one way to limit the number of active mdbs is to give
>> the inbound resource adapter its own thread pool and limit that
>> size.  I think there's a more direct way but don't recall what it is.
>> If the number of outbound connections is at least the number of mdbs
>> I would expect you wouldn't run into problems.
>> Maybe someone with more actual experience can give some more informed
>> advice.
>> thanks
>> david jencks
> --
> View this message in context:
> resources-in-an-MDB-tf3412013s134.html#a10182882
> Sent from the Apache Geronimo - Users mailing list archive at

* This message is intended only for the use of the individual or entity to which it is addressed,
and may contain information that is privileged, confidential and exempt from disclosure under
applicable law. Unless you are the addressee (or authorized to receive for the addressee),
you may not use, copy or disclose the message or any information contained in the message.
If you have received this message in error, please advise the sender by reply e-mail , and
delete the message, or call (collect) 001 613 747 4698. *

View raw message