You're not using the data you've requested, thus stalling the connections.
This is by design. Akka HTTP is a *streaming* HTTP Client.

Please read the docs about this:
http://doc.akka.io/docs/akka/2.4/scala/http/implications-of-streaming-http-entity.html


-- 
Konrad `ktoso` Malawski
Akka <http://akka.io> @ Lightbend <http://lightbend.com>

On 21 July 2016 at 10:09:56, l...@vip.qq.com (l...@vip.qq.com) wrote:


*When I use the pool-client to issue some requests, *

*the program seems only execute only 10 times ,just the value of
`max-connections` ,*

*the remaining 90 requests didn't execute at all;*

*And after a while, *

*the connection in the connection pool are closed ,no more connection alive ~*


*i don't know what happended, thansk for your help ~*



```the scala code ~

val poolFlow = Http().newHostConnectionPool[Int]("www.baidu.com")

(1 to 100).foreach{idx=>
  val futureResponse =
Source.single(httpRequest->1).via(poolFlow).runWith(Sink.head).map(_._1).flatMap(Future.fromTry)
  futureResponse.andThen{
    case Success(_) =>
      println(s"${atomicLong.incrementAndGet()} ->
${Thread.currentThread().getName} ")
    case Failure(e) =>
      e.printStackTrace()
      println(s"error ${e.getMessage}")
  }

}

```


the application.conf

```

http {
  host-connection-pool {
    max-connections = 10
    min-connections = 10
    max-retries = 0
    max-open-requests = 1048576
  }
}

```


--------

the output :

```

after pool ~
after execute !
1 -> httpClient-akka.actor.default-dispatcher-2
4 -> httpClient-akka.actor.default-dispatcher-19
5 -> httpClient-akka.actor.default-dispatcher-12
2 -> httpClient-akka.actor.default-dispatcher-13
6 -> httpClient-akka.actor.default-dispatcher-10
3 -> httpClient-akka.actor.default-dispatcher-8
7 -> httpClient-akka.actor.default-dispatcher-13
8 -> httpClient-akka.actor.default-dispatcher-4
9 -> httpClient-akka.actor.default-dispatcher-4
10 -> httpClient-akka.actor.default-dispatcher-15

```


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups
"Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to