You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sebb <se...@gmail.com> on 2009/02/13 01:06:20 UTC
Re: Setting the max retry count when using "HTTP Request HTTPClient"
Sampler?
On 12/02/2009, Will McQueen <wi...@yahoo.com> wrote:
>
> Hi,
>
> How can I set the max retry count for the HTTP Request HTTPClient (ie, the sample that uses Apache's http client)?
>
> In the jmeter.properties file, I see:
> http.java.sampler.retries=
> ...but that seems to be for the default "Http Javat" Java HTTP implementation ("HTTP Request" sampler) rather than for the Apache http client.
>
> The jmeter.properties file includes this reference:
> http://jakarta.apache.org/commons/httpclient/preference-api.html
> ...which shows a property that seems to be what I need:
> http.method.retry-handler=
> ...but I'm not sure what value to set it to.
>
> Do I need to set it to a fully-qualified class name that I create (as an implementation of interface HttpMethodRetryHandler)?
Looks like it.
> In that case, I think I'd just need to ensure that my implementation of this interface is in the classpath, and JMeter should automatically call the retryMethod(..) method each time it wants to retry? And I can just set the body the method to simply return false.
Try it and see?
> Thank you.
>
> Cheers,
> Will
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Setting the max retry count when using "HTTP Request HTTPClient"
Sampler?
Posted by sebb <se...@gmail.com>.
On 13/02/2009, Will McQueen <wi...@yahoo.com> wrote:
>
> Hi Sebb,
>
> >>> Try it and see?
> Nope, didn't work...
>
> I'm looking at HttpClient's prefs page:
>
> http://hc.apache.org/httpclient-3.x/preference-api.html
>
> ...and I see other prefs (besides http.method.retry-handler) which take a value that can't be expressed in a known/documented String format. For example:
>
> http.protocol.version => HttpVersion
> http.connection-manager.max-per-host => Map
> http.default-headers => Collection
>
> Maybe JMeter wasn't designed to use httpclient prefs that can't be expressed in String form... do you know if this is the case? Maybe these kinds of options need to be surfaced in the Sample GUI instead of the prefs file?
I'd forgotten about that...
According to bin/httpclient.parameters JMeter supports
# Integer
# Long
# Boolean
# HttpVersion
so it looks like it does not support HttpMethodRetryHandler, sorry.
You could add this by updating the source, or probably by using a
BeanShell startup script that does the work. See the method
org.apache.jmeter.protocol.http.sampler.HttpClientDefaultParameters.load()
for how to process the parameters.
I'm not sure that this is worth adding to JMeter.
HttpClient 3.1 is EOL and JMeter will likely move to HC 4 for the next
major release.
> Cheers,
> Will
>
>
> --- On Thu, 2/12/09, sebb <se...@gmail.com> wrote:
>
> > From: sebb <se...@gmail.com>
> > Subject: Re: Setting the max retry count when using "HTTP Request HTTPClient" Sampler?
> > To: "JMeter Users List" <jm...@jakarta.apache.org>, willmcqueen@yahoo.com
> > Date: Thursday, February 12, 2009, 4:06 PM
>
> > On 12/02/2009, Will McQueen <wi...@yahoo.com>
> > wrote:
> > >
> > > Hi,
> > >
> > > How can I set the max retry count for the HTTP
> > Request HTTPClient (ie, the sample that uses Apache's
> > http client)?
> > >
> > > In the jmeter.properties file, I see:
> > > http.java.sampler.retries=
> > > ...but that seems to be for the default "Http
> > Javat" Java HTTP implementation ("HTTP
> > Request" sampler) rather than for the Apache http
> > client.
> > >
> > > The jmeter.properties file includes this reference:
> > >
> > http://jakarta.apache.org/commons/httpclient/preference-api.html
> > > ...which shows a property that seems to be what I
> > need:
> > > http.method.retry-handler=
> > > ...but I'm not sure what value to set it to.
> > >
> > > Do I need to set it to a fully-qualified class name
> > that I create (as an implementation of interface
> > HttpMethodRetryHandler)?
> >
> > Looks like it.
> >
> > > In that case, I think I'd just need to ensure that
> > my implementation of this interface is in the classpath, and
> > JMeter should automatically call the retryMethod(..) method
> > each time it wants to retry? And I can just set the body the
> > method to simply return false.
> >
> > Try it and see?
> >
> > > Thank you.
> > >
> > > Cheers,
> > > Will
> > >
> > >
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > jmeter-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > jmeter-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > jmeter-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: Setting the max retry count when using "HTTP Request HTTPClient" Sampler?
Posted by Will McQueen <wi...@yahoo.com>.
Hi Sebb,
>>> Try it and see?
Nope, didn't work...
I'm looking at HttpClient's prefs page:
http://hc.apache.org/httpclient-3.x/preference-api.html
...and I see other prefs (besides http.method.retry-handler) which take a value that can't be expressed in a known/documented String format. For example:
http.protocol.version => HttpVersion
http.connection-manager.max-per-host => Map
http.default-headers => Collection
Maybe JMeter wasn't designed to use httpclient prefs that can't be expressed in String form... do you know if this is the case? Maybe these kinds of options need to be surfaced in the Sample GUI instead of the prefs file?
Cheers,
Will
--- On Thu, 2/12/09, sebb <se...@gmail.com> wrote:
> From: sebb <se...@gmail.com>
> Subject: Re: Setting the max retry count when using "HTTP Request HTTPClient" Sampler?
> To: "JMeter Users List" <jm...@jakarta.apache.org>, willmcqueen@yahoo.com
> Date: Thursday, February 12, 2009, 4:06 PM
> On 12/02/2009, Will McQueen <wi...@yahoo.com>
> wrote:
> >
> > Hi,
> >
> > How can I set the max retry count for the HTTP
> Request HTTPClient (ie, the sample that uses Apache's
> http client)?
> >
> > In the jmeter.properties file, I see:
> > http.java.sampler.retries=
> > ...but that seems to be for the default "Http
> Javat" Java HTTP implementation ("HTTP
> Request" sampler) rather than for the Apache http
> client.
> >
> > The jmeter.properties file includes this reference:
> >
> http://jakarta.apache.org/commons/httpclient/preference-api.html
> > ...which shows a property that seems to be what I
> need:
> > http.method.retry-handler=
> > ...but I'm not sure what value to set it to.
> >
> > Do I need to set it to a fully-qualified class name
> that I create (as an implementation of interface
> HttpMethodRetryHandler)?
>
> Looks like it.
>
> > In that case, I think I'd just need to ensure that
> my implementation of this interface is in the classpath, and
> JMeter should automatically call the retryMethod(..) method
> each time it wants to retry? And I can just set the body the
> method to simply return false.
>
> Try it and see?
>
> > Thank you.
> >
> > Cheers,
> > Will
> >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jmeter-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org