Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDE7295C2 for ; Wed, 16 Nov 2011 10:18:52 +0000 (UTC) Received: (qmail 72568 invoked by uid 500); 16 Nov 2011 10:18:52 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 72396 invoked by uid 500); 16 Nov 2011 10:18:52 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 72388 invoked by uid 99); 16 Nov 2011 10:18:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 10:18:52 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.212.43 as permitted sender) Received: from [209.85.212.43] (HELO mail-vw0-f43.google.com) (209.85.212.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Nov 2011 10:18:46 +0000 Received: by vws13 with SMTP id 13so9070885vws.2 for ; Wed, 16 Nov 2011 02:18:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=9XGEhp2HsZKJaLNE+ck+ogBe5sMvmKA1dh1xv9zz78A=; b=NfHCE87m7Nad6adKVjFeD29v+tg4+Ma34v2lnWyudBZoH6Xo3VPlGX5oHNLYwiAG+e VD+FltmNQNQ3LeUtPtmei7ADrfb3dpya1CDTAPKLv9GSZNSSqau4GjL9DwjIA12EMUC4 QyjPB4RihkFo6S8HalQUgeJH5n3bnoCPbLTKo= MIME-Version: 1.0 Received: by 10.224.192.3 with SMTP id do3mr16399195qab.58.1321438705810; Wed, 16 Nov 2011 02:18:25 -0800 (PST) Received: by 10.229.181.138 with HTTP; Wed, 16 Nov 2011 02:18:25 -0800 (PST) In-Reply-To: References: Date: Wed, 16 Nov 2011 10:18:25 +0000 Message-ID: Subject: Re: Implementation of message redelivery delay From: Gary Tully To: dev@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 go ahead and make it better, more intuitive. Passing in the message makes s= ense. The backward compatibility requirements are on the setters such that existing config will not break. http://activemq.apache.org/redelivery-policy.html On 15 November 2011 16:02, Hubert, Eric wrot= e: > Gary, I raised AMQ-3597 [1]. > > And of course we are willing to help with the implementation and test cas= e creation, if we are able to. > > As we are still struggling with the "simple" setup of consumer-based rede= livery, this may take some time though. We would like to get a better under= standing of the code before we start looking into a very concrete issue. > > We have also been slightly confused about the specific handling of the co= nsumer for the case of the initial delay, until we found out, that the init= ial delay is only copied to the redeliveryDelay member of the RedeliveryPol= icy at class instantiation time, so that if someone sets this property via = a Spring bean (setter injection) the getNextRedeliveryDelay(long) if called= with 0 will never pickup the configured value. Therefore the differentiati= on is probably moved to the user of the class, although this is not really = intuitive. > > Is everything of the RedeliveryPolicy class (including the getNextRedeliv= eryDelay(long) which does not really represent a conventional getter) consi= dered to be part of the public API? > Changing from a delay to a redeliveryCount should result in rather small = implementation changes (both inside the method implementation as well as th= e broker internal usages), but a bad smell in terms of API change. > Contrary adding another operation with a different name and deprecating t= he existing one would not be of much value either, once all internal usages= are changed. > Thinking about potential future requirements and noticing RedeliveryPolic= y is no interface, but a concrete class it might also be an option to not p= ass in just the redelivery counter, but possibly the message. This could al= low the use of other metadata to influence the way the delivery delay is ca= lculated. > > If you have any preference or some don't, please just shortly comment. Ot= herwise I will update the issue once we look into the implementation. If so= meone wants to beat us, we are of course all open. ;-) > > Thanks, > =A0 Eric > > [1] https://issues.apache.org/jira/browse/AMQ-3597 > >> >> I think a change to pass the redeliveryCount to the redelivery policy >> >> would make sense, such that the policy can determine the delay >> >> independent of the consumer. >> > Yes, this is exactly how I was originally anticipating the >> implementation would work. What are the plans regarding releasing 5.6? A= ny >> chance that such a change could be included? >> >> We are actively trying to lock down 5.6[1] but this change is a nice >> candidate and would require a major version due to the api change so >> now is a good time. >> >> Can you raise a jira issue for this or even submit a patch with a test >> case and we can integrate it. >> > --=20 http://fusesource.com http://blog.garytully.com