diff --git a/akka-stream/src/main/scala/akka/stream/impl/AcknowledgePublisher.scala b/akka-stream/src/main/scala/akka/stream/impl/AcknowledgePublisher.scala index a7973a5462..eb3772ca61 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/AcknowledgePublisher.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/AcknowledgePublisher.scala @@ -55,19 +55,25 @@ private[akka] class AcknowledgePublisher(bufferSize: Int, overflowStrategy: Over enqueueAndSendAck(elem) else overflowStrategy match { case DropHead ⇒ + log.debug("Dropping the head element because buffer is full and overflowStrategy is: [DropHead]") buffer.dropHead() enqueueAndSendAck(elem) case DropTail ⇒ + log.debug("Dropping the tail element because buffer is full and overflowStrategy is: [DropTail]") buffer.dropTail() enqueueAndSendAck(elem) case DropBuffer ⇒ + log.debug("Dropping all the buffered elements because buffer is full and overflowStrategy is: [DropBuffer]") buffer.clear() enqueueAndSendAck(elem) case DropNew ⇒ + log.debug("Dropping the new element because buffer is full and overflowStrategy is: [DropNew]") sendAck(false) case Fail ⇒ + log.error("Failing because buffer is full and overflowStrategy is: [Fail]") onErrorThenStop(new Fail.BufferOverflowException(s"Buffer overflow (max capacity was: $bufferSize)!")) case Backpressure ⇒ + log.debug("Backpressuring because buffer is full and overflowStrategy is: [Backpressure]") sendAck(false) //does not allow to send more than buffer size } } diff --git a/akka-stream/src/main/scala/akka/stream/impl/ActorRefSourceActor.scala b/akka-stream/src/main/scala/akka/stream/impl/ActorRefSourceActor.scala index 4ef5b06d22..897e4a6978 100644 --- a/akka-stream/src/main/scala/akka/stream/impl/ActorRefSourceActor.scala +++ b/akka-stream/src/main/scala/akka/stream/impl/ActorRefSourceActor.scala @@ -60,20 +60,26 @@ private[akka] class ActorRefSourceActor(bufferSize: Int, overflowStrategy: Overf buffer.enqueue(elem) else overflowStrategy match { case DropHead ⇒ + log.debug("Dropping the head element because buffer is full and overflowStrategy is: [DropHead]") buffer.dropHead() buffer.enqueue(elem) case DropTail ⇒ + log.debug("Dropping the tail element because buffer is full and overflowStrategy is: [DropTail]") buffer.dropTail() buffer.enqueue(elem) case DropBuffer ⇒ + log.debug("Dropping all the buffered elements because buffer is full and overflowStrategy is: [DropBuffer]") buffer.clear() buffer.enqueue(elem) case DropNew ⇒ - // do not enqueue new element if the buffer is full + // do not enqueue new element if the buffer is full + log.debug("Dropping the new element because buffer is full and overflowStrategy is: [DropNew]") case Fail ⇒ + log.error("Failing because buffer is full and overflowStrategy is: [Fail]") onErrorThenStop(new Fail.BufferOverflowException(s"Buffer overflow (max capacity was: $bufferSize)!")) case Backpressure ⇒ - // there is a precondition check in Source.actorRefSource factory method + // there is a precondition check in Source.actorRefSource factory method + log.debug("Backpressuring because buffer is full and overflowStrategy is: [Backpressure]") } }