Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 70799 invoked from network); 1 Apr 2005 12:18:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Apr 2005 12:18:06 -0000 Received: (qmail 49952 invoked by uid 500); 1 Apr 2005 12:17:44 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 49941 invoked by uid 500); 1 Apr 2005 12:17:44 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 49925 invoked by uid 99); 1 Apr 2005 12:17:44 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from smarty.dreamhost.com (HELO smarty.dreamhost.com) (66.33.216.24) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 01 Apr 2005 04:17:43 -0800 Received: from strange.dreamhost.com (strange.dreamhost.com [66.33.193.57]) by smarty.dreamhost.com (Postfix) with ESMTP id 51D3513F7A7 for ; Fri, 1 Apr 2005 04:17:38 -0800 (PST) Received: by strange.dreamhost.com (Postfix, from userid 7734) id 3AD286A902; Fri, 1 Apr 2005 04:17:37 -0800 (PST) Date: Fri, 1 Apr 2005 06:17:37 -0600 From: QM To: Tomcat Users List Subject: Re: [OT] Proper way to open threads in a servlet Message-ID: <20050401121737.GA589@strange.dreamhost.com> References: <20050401123913.620f88cd.lionel.farbos@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Fri, Apr 01, 2005 at 11:45:40AM +0100, Mark Benussi wrote: : I would place your e-mail in a MailManager that queues the messages and : sends them out on a TimerTask (Every 10 seconds???). Why not just use JMS? The servlet puts messages in a queue and returns to the user. In turn, a queue listener turns those messages into e-mails. [solves the problem of delaying the user response while e-mails are sent] If you don't have a separate server/service to run the queue listener, do that inside a single Tomcat thread that is created/destroyed by a ServletContextListener. [solves the thread hanging problem, as well as the too-many-threads problem.] -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org