diff --git a/akka-docs-dev/rst/java/http/client-side/request-level.rst b/akka-docs-dev/rst/java/http/client-side/request-level.rst index daf33add03..c731e13ed4 100644 --- a/akka-docs-dev/rst/java/http/client-side/request-level.rst +++ b/akka-docs-dev/rst/java/http/client-side/request-level.rst @@ -54,3 +54,20 @@ with the futures completion. For example you should not access the Actors state to the Actor as a message: .. includecode:: ../../code/docs/http/javadsl/HttpClientExampleDocTest.java#single-request-in-actor-example + + +.. warning:: + Be sure to consume the response entities ``dataBytes:Source[ByteString,Unit]`` by for example connecting it + to a ``Sink`` (for example ``response.entity.dataBytes.runWith(Sink.ignore)`` if you don't care about the + response entity), since otherwise Akka HTTP (and the underlying Streams infrastructure) will understand the + lack of entity consumption as a back-pressure signal and stop reading from the underlying TCP connection! + + This is a feature of Akka HTTP that allows consuming entities (and pulling them through the network) in + a streaming fashion, and only *on demand* when the client is ready to consume the bytes - + it may be a bit suprising at first though. + + There are tickets open about automatically dropping entities if not consumed (`#18716`_ and `#18540`_), + so these may be implemented in the near future. + +.. _#18540: https://github.com/akka/akka/issues/18540 +.. _#18716: https://github.com/akka/akka/issues/18716 diff --git a/akka-docs-dev/rst/scala/http/client-side/request-level.rst b/akka-docs-dev/rst/scala/http/client-side/request-level.rst index b262b0b660..c322058ff7 100644 --- a/akka-docs-dev/rst/scala/http/client-side/request-level.rst +++ b/akka-docs-dev/rst/scala/http/client-side/request-level.rst @@ -61,4 +61,21 @@ Example ------- .. includecode:: ../../code/docs/http/scaladsl/HttpClientExampleSpec.scala - :include: single-request-example \ No newline at end of file + :include: single-request-example + + +.. warning:: + Be sure to consume the response entities ``dataBytes:Source[ByteString,Unit]`` by for example connecting it + to a ``Sink`` (for example ``response.entity.dataBytes.runWith(Sink.ignore)`` if you don't care about the + response entity), since otherwise Akka HTTP (and the underlying Streams infrastructure) will understand the + lack of entity consumption as a back-pressure signal and stop reading from the underlying TCP connection! + + This is a feature of Akka HTTP that allows consuming entities (and pulling them through the network) in + a streaming fashion, and only *on demand* when the client is ready to consume the bytes - + it may be a bit suprising at first though. + + There are tickets open about automatically dropping entities if not consumed (`#18716`_ and `#18540`_), + so these may be implemented in the near future. + +.. _#18540: https://github.com/akka/akka/issues/18540 +.. _#18716: https://github.com/akka/akka/issues/18716