From users-return-15349-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Thu Aug 07 19:10:46 2008 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 87895 invoked from network); 7 Aug 2008 19:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2008 19:10:45 -0000 Received: (qmail 43572 invoked by uid 500); 7 Aug 2008 19:10:44 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 43555 invoked by uid 500); 7 Aug 2008 19:10:44 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 43544 invoked by uid 99); 7 Aug 2008 19:10:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 12:10:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bruce.snyder@gmail.com designates 209.85.200.171 as permitted sender) Received: from [209.85.200.171] (HELO wf-out-1314.google.com) (209.85.200.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 19:09:45 +0000 Received: by wf-out-1314.google.com with SMTP id 26so492139wfd.26 for ; Thu, 07 Aug 2008 12:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=UaPjn3Jvb+f6BeH62nXQFLMMRcWuwamGsTvXaReeTv4=; b=QVC/33TPTg8NIKNLOnFYsSC1pg8c7jWqvsSuYDvvUc7Q5fEhf5/USwDS/hX9h1fyEb rrxnCzeH5zw9IPCUKi+cc4dKm14z+IpttN5Ck2OgD6oMn9fCXI9psWk7PEyUMo6fESKY c1nkO4QETXEEv+g/3quDzABIyUogl+MV7s1X0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=FFXggflR2t7c7yJRRbop7H9Y3uwX/WdLZf1wIBANFODKVxaKUUwMzJeKh5Gr9xN0cB h20WlyvzjJ5VzxiKLAl1miMFHOVGrUof/eRraRT7kzeO+ixAa0Hw2wd0gXq2DXx4KZqX JhzQn4UavbZKx+xymrI4N4Vz3LDbWqzvfN2MU= Received: by 10.142.48.14 with SMTP id v14mr599519wfv.133.1218136212993; Thu, 07 Aug 2008 12:10:12 -0700 (PDT) Received: by 10.142.230.2 with HTTP; Thu, 7 Aug 2008 12:10:12 -0700 (PDT) Message-ID: <7b3355cb0808071210h18aea550x917d0f30f0917464@mail.gmail.com> Date: Thu, 7 Aug 2008 13:10:12 -0600 From: "Bruce Snyder" To: users@activemq.apache.org Subject: Re: (hopefully) simple JMS question In-Reply-To: <18877105.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <18877105.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Aug 7, 2008 at 12:41 PM, David Crisp wrote: > > Hi, > I have a quick question regarding the JMS spec and I was hoping to > solicit > feedback from our merry band of domain experts. > > Given that Sessions are not thread-safe, if I'm creating a little > client-side > API that gets hit by a myriad of threads and do not want to synchronize > the API points, I need to create a new Session on the stack for each > thread context. Destinations ARE thread safe, but are created via a > specific Session instance. Given this, can I assume that destination > instances > remain valid even after the Session that created them is destroyed? I've > looked at > the JMS spec and it seems fairly silent on this point. > > Thanks in advance, > D. > > P.s. I'm assuming this must be true given that Destination creation can't > be cheap since it requires communication with the broker. Yes, once a destination has been created, it will exist on the broker even if the session that created it is destroyed. This is because the session is simply used to interact with the broker and send it commands. Bruce -- perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E