From user-return-6517-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Thu Apr 26 18:01:07 2007 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 31517 invoked from network); 26 Apr 2007 18:01:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 18:01:06 -0000 Received: (qmail 37549 invoked by uid 500); 26 Apr 2007 18:01:10 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 37519 invoked by uid 500); 26 Apr 2007 18:01:10 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 37508 invoked by uid 99); 26 Apr 2007 18:01:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 11:01:10 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [64.18.1.183] (HELO exprod6og51.obsmtp.com) (64.18.1.183) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Apr 2007 11:01:02 -0700 Received: from source ([66.46.195.131]) by exprod6ob51.postini.com ([64.18.5.12]) with SMTP; Thu, 26 Apr 2007 11:00:09 PDT In-Reply-To: Subject: Re: Sharing resources in an MDB To: user@geronimo.apache.org X-Mailer: Lotus Notes Release 7.0 August 18, 2005 Message-ID: From: Aman Nanner/MxI Technologies Date: Thu, 26 Apr 2007 14:00:13 -0400 X-MIMETrack: Serialize by Router on Oceanus/MxI Technologies(Release 7.0|August 18, 2005) at 04/26/2007 02:00:14 PM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org So the solution you proposed seems to work with one caveat. It does limit the MDB to only one instance, and in that sense it works. However, if another JMS message is received on the queue while the MDB is still processing the last message, a synchronization error occurs: Caused by: edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionException at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution( ThreadPoolExecutor.java:1519) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.reject( ThreadPoolExecutor.java:407) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.execute( ThreadPoolExecutor.java:880) at org.apache.geronimo.pool.ThreadPool.execute(ThreadPool.java:201) at org.apache.geronimo.pool.ThreadPool.execute(ThreadPool.java:173) at org.apache.geronimo.pool.ThreadPool$$FastClassByCGLIB$$a77708d8.invoke() at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53) at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke( FastMethodInvoker.java:38) at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke( GBeanOperation.java:122) at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke( GBeanInstance.java:820) at org.apache.geronimo.gbean.runtime.RawInvoker.invoke( RawInvoker.java:57) at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke( RawOperationInvoker.java:35) at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept( ProxyMethodInterceptor.java:96) at org.apache.geronimo.pool.GeronimoExecutor$$EnhancerByCGLIB$$b29ee60a.execute() at org.apache.geronimo.connector.work.pool.ScheduleWorkExecutor.doExecute( ScheduleWorkExecutor.java:36) at org.apache.geronimo.connector.work.GeronimoWorkManager.executeWork( GeronimoWorkManager.java:196) at org.apache.geronimo.connector.work.GeronimoWorkManager.scheduleWork( GeronimoWorkManager.java:182) at org.apache.geronimo.connector.work.GeronimoWorkManager$$FastClassByCGLIB$$907eef28.invoke() David Jencks wrote on 04-25-2007 11:35:59 AM: > > 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 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: > > > DefaultWorkManager > > > > So you could include a thread pool: > > class="org.apache.geronimo.pool.ThreadPool"> > 5000 > 1 > SingleThreadPool > > > and use it: > > > SingleWorkManager > > > 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: http://www.nabble.com/Sharing- > > resources-in-an-MDB-tf3412013s134.html#a10182882 > > Sent from the Apache Geronimo - Users mailing list archive at > > Nabble.com. > > > __________________________________________________________________________________ * 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. *