Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-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 944A018902 for ; Wed, 14 Oct 2015 21:02:24 +0000 (UTC) Received: (qmail 84878 invoked by uid 500); 14 Oct 2015 21:02:24 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 84827 invoked by uid 500); 14 Oct 2015 21:02:24 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 84816 invoked by uid 99); 14 Oct 2015 21:02:24 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2015 21:02:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 9B5511A236C for ; Wed, 14 Oct 2015 21:02:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id V4ZBNrbNwDTO for ; Wed, 14 Oct 2015 21:02:10 +0000 (UTC) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com [209.85.160.169]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id E7DB725772 for ; Wed, 14 Oct 2015 21:02:09 +0000 (UTC) Received: by ykoo7 with SMTP id o7so59817390yko.0 for ; Wed, 14 Oct 2015 14:02:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:message-id:references:to; bh=eOFT7FnvZHjtrUGnTe4tImmPL+HyAPs5UXuHQ5S3dFM=; b=EDL2tm/bFv+1gWVa96zYIPoRd+SmOBo9DCI5mG4jKPb6CDjTVe6pMMjfOEV1CtsnbI 4NLxj4dNb5MAOJ+zLWz/4U/pIBJ6IatwJX4fMB3NXQbIQqNdOzEpf+s43GDHrq6Nfdsq xoVtJpzPk8sbhIxQeVxOlSXJyv3Xxytqfo2Q8B8ETGAWmvGHuE07BB5zf2Bzfynzkfdy Fq0Pa+p59O8Vrts2s9YQF5rn36Z7CMYu5/EfEl6RJoYd3A1Qbos8D8qKJ0TyljmBSGi9 ytiVFrBoRvcxbTcSCjV0T8JOfJ2O61qPuNmx6H9DDqgQD8Dc2gSD2BkqkXTo9bR6+Q+T u4AA== X-Gm-Message-State: ALoCoQnZaO13QuZwP66rhq9d+YHHKT8tqIX1W4n9oMKOUmD0i+y67GwYFxAB0DHvhBiF8Hh0ktX2 X-Received: by 10.129.158.133 with SMTP id v127mr4051802ywg.135.1444856528341; Wed, 14 Oct 2015 14:02:08 -0700 (PDT) Received: from basileus.attlocal.net (108-213-212-250.lightspeed.clmboh.sbcglobal.net. [108.213.212.250]) by smtp.gmail.com with ESMTPSA id f67sm7380503ywd.19.2015.10.14.14.02.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Oct 2015 14:02:07 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_CF4091D9-76A1-4C90-908B-C01C5E34C49B"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Subject: Re: Responding adaptively to 503 errors (including respecting the Retry-After header) X-Pgp-Agent: GPGMail 2.6b2 From: Mike Conley In-Reply-To: Date: Wed, 14 Oct 2015 17:02:05 -0400 Message-Id: <19738008-45D3-4C53-B412-F21A809C0EDA@unizin.org> References: To: HttpClient User Discussion X-Mailer: Apple Mail (2.3094) --Apple-Mail=_CF4091D9-76A1-4C90-908B-C01C5E34C49B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Oh, nice! I assume this hasn=E2=80=99t been released yet, though, right? = If it has been, the javadocs need updating :P Glad it=E2=80=99s been handled either way. Thanks for the info. > On Oct 14, 2015, at 4:59 PM, Stefan Magnus Landr=C3=B8 = wrote: >=20 > Newer versions handle the retry-after header: > = https://github.com/apache/httpclient/blob/trunk/httpclient/src/main/java/o= rg/apache/http/client/ServiceUnavailableRetryStrategy.java >=20 > Have a look at the default impl: >=20 > = https://github.com/apache/httpclient/blob/trunk/httpclient/src/main/java/o= rg/apache/http/impl/client/DefaultServiceUnavailableRetryStrategy.java >=20 > 2015-10-14 22:49 GMT+02:00 Mike Conley : >=20 >> Hi. >>=20 >> I=E2=80=99m writing an OAI harvester (it=E2=80=99s an obscure = protocol you=E2=80=99ve probably >> never heard of for the exchange of metadata with content = repositories). The >> implementation guidelines mention 503 handling: >> = http://www.openarchives.org/OAI/2.0/guidelines-harvester.htm#FlowControl. >> In particular, the suggestion is to respect the Retry-After header if >> present. >>=20 >> When last I did this, I had to implement it myself, but I see that >> HttpClient 4 has 503 handling built in. >>=20 >>=20 >> = http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apach= e/http/client/ServiceUnavailableRetryStrategy.html >>=20 >> But I=E2=80=99m not sure how to use this if the retry interval should = vary >> per-response. getRetryInterval takes no arguments, and in particular = has no >> access to the HttpResponse, so I=E2=80=99m not sure how I could go = about using >> this. I had considered storing something when the call to = retryRequest is >> made, but I=E2=80=99m not sure this is safe to do (it seems likely = that it is not, >> since the strategy is almost certainly shared among multiple = threads). It >> also seems kind of kludgy to me. Is there a way to do this cleanly? = If not, >> is there a thread safe way to keep this state around between calls to = the >> two methods? >>=20 >>=20 >=20 >=20 > -- > BEKK Open > http://open.bekk.no >=20 > TesTcl - a unit test framework for iRules > http://testcl.com --Apple-Mail=_CF4091D9-76A1-4C90-908B-C01C5E34C49B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJWHsLNAAoJEPfUVehA0imDZWMP/11qEddnzks6pRaTexp7JI5r ofchA12O59xFZpeHaFySoxSJ1omhUhZoM80CA6hEKmNylJMAYNFVISLkJJiuhsva OD/M7XD3LA1OYVHN12fwd1KEk458tY6oDwSgoMepLUIPbz9HCEjo+LTXRNFlMAM5 A9ORulmULlkd8vN+sthfdC6kdh2YKkoy0g7pt6cSKptpVeCj5hj4DRFOLV91soIb Cf4bWA7n7mcJg/WCtLqyoMf5oIOPeSYX6jV/rnljHc4dqZjiESH+x8zqdOXzcHix 1LRgJqiJm/lBh53d3FIG8WvALGcyNzCp4zT8K8WPpvAtX5kBgpFPjpGKK6o/iaWp V5RTfHq00hJyoUp3adUVq4VjyvXVH7w265/6L+PsaDmqTEAXmJ2FZS2dRUAuAcqS K5YvqdSF8MbYlf2bzzJodhBWbfqMoi1hHT1X6OzrEw9U7QuWhPeC3f/RsSRfR54k 0+jlDQ+QzCN12xyGWLS03ox+ZlqEZ6hjxsUouC39mw6Mqavbc0S5kUak+uRBt1qn oSUOwQHgKrcdLRHbdxbGA+8CcQ3d59F38kSFYUjUHndtIFnom3fYalRM3ZTf2MoW e7mG2kW8FdMPRxpiWqUwfC8gZhGJg9lXe/Rernyi9ombR0Kfet5ZhO7lEzIY7lzj MWXDBgfeC4m1atMBIkFZ =N0I6 -----END PGP SIGNATURE----- --Apple-Mail=_CF4091D9-76A1-4C90-908B-C01C5E34C49B--