Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BD1149FB9 for ; Tue, 26 Jun 2012 13:47:16 +0000 (UTC) Received: (qmail 22355 invoked by uid 500); 26 Jun 2012 13:47:16 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 22280 invoked by uid 500); 26 Jun 2012 13:47:15 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 22265 invoked by uid 99); 26 Jun 2012 13:47:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 13:47:15 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zhihua.che@gmail.com designates 209.85.160.170 as permitted sender) Received: from [209.85.160.170] (HELO mail-gh0-f170.google.com) (209.85.160.170) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jun 2012 13:47:09 +0000 Received: by ghbg2 with SMTP id g2so3512625ghb.15 for ; Tue, 26 Jun 2012 06:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=VOLwfBs8/79Lit1wSZRIHB+J5tyZMH78rf2xmARR4t0=; b=UKlqMHILA74LRZlc50DuR+TsBezFyKqqqsuhDh26WEO1YAwrVtFZnCqhb4/IlcZNBu jiqSpciMk1xQn8x/HijMOmIXS0CE2Nd3HewucnJQb68kBYTU1HvzqSrDSDbOHIvhh8na hv6NUT7XtutdEl6bI7GOHbGt8xT2kbO3YCWZk4qQYPH4NECx3zw/sYSKJ8O6RcdUPtGj q9lL6UYVK+w769+j7dxBgjvehvvGvkA1MwSWTT8CXvIiaeSlasaEzEcMz/nkt0cgGHiq LMuHroGIVnIeTR5BNHU2QAz2uPdcHQmnHczyl0Om5JAhkcMUYhQRX+KNPSP594f734MS cDAQ== MIME-Version: 1.0 Received: by 10.42.210.193 with SMTP id gl1mr8028221icb.57.1340718408147; Tue, 26 Jun 2012 06:46:48 -0700 (PDT) Received: by 10.231.51.222 with HTTP; Tue, 26 Jun 2012 06:46:48 -0700 (PDT) Date: Tue, 26 Jun 2012 21:46:48 +0800 Message-ID: Subject: ThreadSafe/Multiple Session/Connection handling From: Zhihua Che To: users Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm employing qpid in my current project and need some tips for common programming practice. 1, Are Sender/Receiver/Session/Connection thread-safe? ie, Is it ok for multiple threads to send messages through the same sender, or to create senders/receivers through the same session. 2, When do I need to create a separate session? I know it's feasible to create more than one session in one application/process, but, I wonder when it's reasonable to create two session, instead of only one. 3, How do I handle the connection lost or sending/receiving failure? In my application, sending/receiving fails occasionally with an exception throw. What can I do to fix it and take another try initiatively at runtime if I refuse to exit the process? Is it reasonable to open the connection again and create new senders and receivers to take a new try? I know there is reconnect option for the Connection. But It cannot keep connection alive forever, right? Furthermore, I find qpid client api doesn't offer a connection pool mechanism, Does that mean I need to implement one by myself if I want or the connection pool is not recommended? --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org