Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 20522 invoked from network); 13 Jan 2011 11:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Jan 2011 11:10:45 -0000 Received: (qmail 7014 invoked by uid 500); 13 Jan 2011 11:10:45 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 6790 invoked by uid 500); 13 Jan 2011 11:10:43 -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 6782 invoked by uid 99); 13 Jan 2011 11:10:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 11:10:42 +0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.216.178 as permitted sender) Received: from [209.85.216.178] (HELO mail-qy0-f178.google.com) (209.85.216.178) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Jan 2011 11:10:36 +0000 Received: by qyk33 with SMTP id 33so1661425qyk.2 for ; Thu, 13 Jan 2011 03:10:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=OnetBwEc73xf71tR9j85443aN7piFjWlOekVqf1IZug=; b=DLbbgikxp3Px9SymUd/QnBG+JFlDHMX8uRmEgDdlFzxF/S6PSl/DkXWvRS/a3/KDeh NnHi9KVZmQyEJAsQoefNJVCPv6Ok/yQACQqqUxSS5VjxyMEgwK3q7/97jtl0o6/70lUN 8fbdaw7tl3eQCsdzfkRYb1whvydaurmfxAyak= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bV5XnqsEHw7ht8QCdYoUc65BG2y8+Ab/02Fj7t2My7NQEbKS5aDsEsCjfxZmbXxaAi aD1l7XEQKKr49yxa9R8svDgqmOKFgmMThpP9kraLqAshNMos2wijgQDHMAyBNkyrfqMK Z0HYZs2/fshD5YvCAuYS9hkWBOuD/5vXkfx7Y= MIME-Version: 1.0 Received: by 10.229.189.194 with SMTP id df2mr1729717qcb.232.1294917014331; Thu, 13 Jan 2011 03:10:14 -0800 (PST) Received: by 10.229.107.3 with HTTP; Thu, 13 Jan 2011 03:10:14 -0800 (PST) In-Reply-To: <1294786384663-3209848.post@n4.nabble.com> References: <1294786384663-3209848.post@n4.nabble.com> Date: Thu, 13 Jan 2011 11:10:14 +0000 Message-ID: Subject: Re: durable topic subscriber using spring and atomikos From: Gary Tully To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org You cannot use a connection pool if you are setting the client Id on a connection factory because a durable sub can only be active on a single connection at a time. A durable subscription is tied to a well known clientId and subscriptionName, message are stored based on this identity and it needs to be unique so that the ordering and delivery can be guaranteed. It is possible to configure the container to specify the clientId on an individual connection basis such that you don't set it on the factory? What is your use case for using a durable subscription and a connection poo= l. Some more detail in an answer from a while back: http://osdir.com/ml/java.activemq.user/2005-05/msg00141.html On 11 January 2011 22:53, softweave wrote: > > I wrote a topic listener that works fine as a non-durable topic subscribe= r. I > want to convert it to a durable topic subscriber, but am running into > problems. > > This portion of the spring configuration sets up the topic listener: > > =A0 =A0 =A0 =A0 class=3D"org.apache.activemq.ActiveMQXAConnectionFactory"> > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0class=3D"com.atomikos.jms.AtomikosConnecti= onFactoryBean" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0init-method=3D"init" destroy-method=3D"clo= se"> > =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > =A0 =A0> > =A0 =A0 =A0 =A0 =A0 > =A0 =A0 > > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0class=3D"com.atomikos.jms.extra.MessageDri= venContainer" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0init-method=3D"start" destroy-method=3D"st= op"> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ref=3D"atomikosConnectionFactoryBean" /> > =A0 =A0 =A0 =A0 =A0 =A0 name=3D"transactionTimeout">120 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 bean=3D"eventListener"/> > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > > If I uncomment out the clientID and subscriberName properties, it gets th= e > following error: > > WARN-[2011-01-07 22:39:20,262][Thread-5][Error delegating 'start' call to > JMS driver > javax.jms.InvalidClientIDException: Broker: localhost - Client: > xaEventListenerConnection already connected from /127.0.0.1:2299 > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker= .java:243) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:8= 5) > =A0 =A0 =A0 =A0at > org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.= java:78) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:8= 5) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:8= 5) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBroke= rFilter.java:91) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.TransportConnection.processAddConnection(Trans= portConnection.java:696) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConne= ction(ManagedTransportConnection.java:83) > =A0 =A0 =A0 =A0at > org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:137) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.TransportConnection.service(TransportConnectio= n.java:311) > =A0 =A0 =A0 =A0at > org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConne= ction.java:185) > =A0 =A0 =A0 =A0at > org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.j= ava:69) > =A0 =A0 =A0 =A0at > org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNe= gotiator.java:113) > =A0 =A0 =A0 =A0at > org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonit= or.java:228) > =A0 =A0 =A0 =A0at > org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport= .java:83) > =A0 =A0 =A0 =A0at > org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:22= 0) > =A0 =A0 =A0 =A0at > org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:202) > =A0 =A0 =A0 =A0at java.lang.Thread.run(Unknown Source) > ][-atomikos][com.atomikos.diagnostics.Slf4jConsole.println(Slf4jConsole.j= ava:107)] > WARN-[2011-01-07 22:39:20,278][Thread-5][MessageConsumerSession: Error in > JMS thread > > How do I prevent this? > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/durab= le-topic-subscriber-using-spring-and-atomikos-tp3209848p3209848.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > --=20 http://blog.garytully.com http://fusesource.com