On 12/01/06, Roland Weber <[EMAIL PROTECTED]> wrote: > sebb wrote: > > We are using HttpClient in Apache JMeter. > > This uses multiple threads to simulate multiple users. > > > > We don't use HttpClient and a Connection Manager, as we specifically > > don't want to share connections between threads. Instead, we create > > our own HttpConnection objects and pass these to > > > > method.execute(state.connection). > > > > I'm now wondering whether this is a sensible approach? > > > > Perhaps we are missing out by not using a method such as: > > > > httpClient.executeMethod(method) > > > > I would have expected the two approaches to be much the same, but on > > looking at the latter, this is handled via HttpMethodDirector, which > > seems to do rather more than method.execute() does. > > > > Should we be using a customised ConnectionManager instead? > > No need to use a customized ConnectionManager. Just create a > separate instance of HttpClient for each thread. By default, > HttpClient instances get a SimpleConnectionManager which uses > a single connection. This will provide the thread separation > you require, while allowing you to use httpClient.executeMethod. > > hope this helps,
Thanks! I've looked at the SimpleConnectionManager docs, but I can't seem to determine what happens if a single thread makes requests to different host-port combinations without closing them in between. getConnection[WithTimeout] says that it blocks until a connection is available, but there is no clue as to what "available" means. Also, there does not appear to be a shutdown() method. This suggests that the thread will need to keep track of all its connections. S. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
