I'm writing a Spray client for the Jenkins build server. I can query a project with up to 18 build results but a project with 31 has the behaviour that my client never receives the response. I can do this successfully with curl
so I'm at a loss for what to look at next.
I do not believe this is about a chunked transfer encoding as I don't see that header in the successful response - although I may be mistaken in my understand of what should happen.
object JenkinsBuildStatus extends App {
implicit val system = ActorSystem("JenkinsBuildStatus")
import system.dispatcher // execution context for futures
val log = Logging(system, getClass)
val pipeline: HttpRequest => Future[HttpResponse] = (
addCredentials(BasicHttpCredentials("username","foobar"))
~> addHeader("Accept", MediaRanges.`*/*`.value)
~> addHeader("User-Agent", "curl/7.37.1")
~> logRequest(log)
~> sendReceive
~> logResponse(log)
)
val response: Future[HttpResponse] = pipeline(Get("https://jenkinsbuilds.corp.com/jenkins/job/Project-Java1.8/api/json/"))
response onComplete {
case Success(data) => {
log.info (data.toString())
shutdown()
}
case Failure(error) => {
log.error(error, "Failure with web client")
shutdown()
}
}
def shutdown(): Unit = {
IO(Http).ask(Http.CloseAll)(1.second).await
system.shutdown()
}
}