From users-return-29044-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Sat Oct 8 07:45:48 2011 Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-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 7253476BD for ; Sat, 8 Oct 2011 07:45:48 +0000 (UTC) Received: (qmail 15023 invoked by uid 500); 8 Oct 2011 07:45:48 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 14937 invoked by uid 500); 8 Oct 2011 07:45: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 14924 invoked by uid 99); 8 Oct 2011 07:45:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 07:45:44 +0000 X-ASF-Spam-Status: No, hits=2.0 required=5.0 tests=SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of luks@spoluzaci.cz) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2011 07:45:38 +0000 Received: from joe.nabble.com ([192.168.236.139]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1RCRaw-00021w-Gu for users@activemq.apache.org; Sat, 08 Oct 2011 00:45:18 -0700 Date: Sat, 8 Oct 2011 00:45:18 -0700 (PDT) From: LFS To: users@activemq.apache.org Message-ID: <1318059918505-3884602.post@n4.nabble.com> Subject: One session for more consumers MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I have question whether more Consumers can use one session? or I have create for each consumer new session? And one more question. Can I use one instance of MyMessageListener for each consumer? or I have create for each consumer new instance of MyMessageListener? For better idea this is segment of my code: .............. session = (ActiveMQSession) connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE); // Create the destinations and consumers consumersFromTopic=new MessageConsumer[user.getUserfriends().size()]; for(int i=0; i