https://kotlinlang.org logo
#http4k
Title
# http4k
r

Razi Kheir

10/04/2019, 7:22 AM
I’m having an issue creating a jettyClient with a connection pool. The JettyClient expects an HttpClient while this one returns an object that is a ClosableHttpClient
Does this seem okay?
Copy code
val httpClient = JettyClient(
            client = HttpClient().apply {
                isFollowRedirects = false
                cookieStore = HttpCookieStore.Empty()
                maxConnectionsPerDestination = 30
            })
d

dave

10/05/2019, 9:20 AM
TBH, I've also not used the Jetty Client (it was a contribution) - it looks ok on the face of it (sorry for not being more helpful!)
With regards to the original issue, It looks like you were creating an Apache
org.apache.http.client.HttpClient
instead of a
org.eclipse.jetty.client.HttpClient
which is what the JettyClient uses.