Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 80245 invoked from network); 27 Sep 2006 14:28:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Sep 2006 14:28:46 -0000 Received: (qmail 4840 invoked by uid 500); 27 Sep 2006 14:28:39 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 4824 invoked by uid 500); 27 Sep 2006 14:28:39 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 4800 invoked by uid 99); 27 Sep 2006 14:28:39 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Sep 2006 07:28:39 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=rajdavies@gmail.com; spf=pass Authentication-Results: idunn.apache.osuosl.org header.from=rajdavies@gmail.com; domainkeys=good X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE Received-SPF: pass (idunn.apache.osuosl.org: domain gmail.com designates 66.249.92.168 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [66.249.92.168] ([66.249.92.168:46035] helo=ug-out-1314.google.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 2E/70-27564-49A8A154 for ; Wed, 27 Sep 2006 07:28:37 -0700 Received: by ug-out-1314.google.com with SMTP id 29so59445ugc for ; Wed, 27 Sep 2006 07:28:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:in-reply-to:references:content-type:message-id:from:subject:date:to:x-mailer; b=Nk1usymCnYki9RP7c/7t2aIr2nlgNWe0N9n8i4WlZm/m5zp0U3IyV/7dR0L7dZpWGjukHjRNhVaE3jpaQlmNUrkXL0gLKvj50BIcesgxf/ci/VnmLuNCZLQNXZoMU4izl5PPQn7Ahom0jLqIGGjJeI01tEqcASOe8NsE6ScKtjs= Received: by 10.67.89.5 with SMTP id r5mr55184ugl; Wed, 27 Sep 2006 07:28:33 -0700 (PDT) Received: from ?192.168.15.101? ( [81.132.69.45]) by mx.gmail.com with ESMTP id e33sm528970ugd.2006.09.27.07.28.32; Wed, 27 Sep 2006 07:28:33 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <451A8120.8040001@tid.es> References: <451A8120.8040001@tid.es> Content-Type: multipart/alternative; boundary=Apple-Mail-10-671469995 Message-Id: From: Rob Davies Subject: Re: QueueBridge and remote broker reconnections Date: Wed, 27 Sep 2006 15:28:16 +0100 To: activemq-users@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Apple-Mail-10-671469995 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi Manuel, this looks like a good catch! Would mind opening a jira on this - just so it's easier to track - I'll look at this as soon as I can cheers, Rob On 27 Sep 2006, at 14:48, Manuel Teira wrote: > Hello. > > Looking at the code in DestinationBridge > (org.apache.activemq.network.jms), I see that when the deliver of a > message to the remote broker fails, there's a counter implemented > as the var 'attempt' that seems to be thought to mark fails and try > to restart the producer. > > But, shouldn't that variable be a member of the DestinationBridge > class instead of a local variable of the onMessage member method? > In this way, the var is always initialized to zero for every > onMessage call. So, restartProducer is never called: > > public void onMessage(Message message) { > if (started.get() && message != null) { > int attempt = 0; > try { > if (attempt > 0) { > restartProducer(); > } > ... > > In my tests, I've tryed changing the var 'attempt' to be an object > member. Now, restartProducer() is called but it seems that the new > connection is not being used. Looking at the code, I don't > understand how calling > > jmsConnector.restartProducerConnection() > > > is really changing the environment of > > createProducer() > > in the QueueBridge subclass. > > For example, for the QueueBridge subclass, createProducer is using > the member producerConnection: > > protected MessageProducer createProducer() throws JMSException{ > producerSession=producerConnection.createQueueSession > (false,Session.AUTO_ACKNOWLEDGE); > producer = producerSession.createSender(null); > return producer; > } > > but I think that this is not related anymore with the > JmsQueueConnector outboundQueueConnection, that is the only > affected member in jmsConnector.restartProducerConnection(). I > don't ever know how or who, in the initialization is setting up the > QueueBridge producerConnection member, calling, I suppose, > setProducerConnection. > I think that a solution to this should be to be able to change the > producerConnection of QueueBridge when we are restarting the > Producer. But for that, we should need to implement > restartProducer in the DestinationBridge subclasses. > > > Any hint or idea? I really need to have remote bridge reconnections > working urgently, so please, if you need further info, make me know. > > Regards. > > --Apple-Mail-10-671469995--