diff --git a/src/main/scala/com/ing/wbaa/rokku/proxy/api/TestService.scala b/src/main/scala/com/ing/wbaa/rokku/proxy/api/TestService.scala index 1e23b42e..46f15ebe 100644 --- a/src/main/scala/com/ing/wbaa/rokku/proxy/api/TestService.scala +++ b/src/main/scala/com/ing/wbaa/rokku/proxy/api/TestService.scala @@ -38,6 +38,33 @@ trait TestService { complete(StatusCodes.ServiceUnavailable -> "503") } } + } ~ path("test200") { + put { + parameters("timeout".as[Long]) { (timeout) => + logger.debug("start test200")(RequestId("test200")) + Thread.sleep(timeout) + logger.debug("stop test200")(RequestId("test200")) + complete(StatusCodes.OK -> "test") + } + } + } ~ path("test502") { + put { + parameters("timeout".as[Long]) { (timeout) => + logger.debug("start test502")(RequestId("test200")) + Thread.sleep(timeout) + logger.debug("stop test502")(RequestId("test200")) + complete(StatusCodes.BadGateway -> "502") + } + } + } ~ path("test503") { + put { + parameters("timeout".as[Long]) { (timeout) => + logger.debug("start test503")(RequestId("test503")) + Thread.sleep(timeout) + logger.debug("stop test503")(RequestId("test503")) + complete(StatusCodes.ServiceUnavailable -> "503") + } + } } } diff --git a/src/main/scala/com/ing/wbaa/rokku/proxy/handler/RequestHandlerS3.scala b/src/main/scala/com/ing/wbaa/rokku/proxy/handler/RequestHandlerS3.scala index cf2ca9b5..eaecc0e9 100644 --- a/src/main/scala/com/ing/wbaa/rokku/proxy/handler/RequestHandlerS3.scala +++ b/src/main/scala/com/ing/wbaa/rokku/proxy/handler/RequestHandlerS3.scala @@ -14,7 +14,7 @@ import com.ing.wbaa.rokku.proxy.provider.aws.SignatureHelpersCommon.awsVersion import com.ing.wbaa.rokku.proxy.queue.UserRequestQueue import scala.concurrent.{ ExecutionContext, Future } -import scala.util.Success +import scala.util.{ Failure, Success } trait RequestHandlerS3 extends S3Client with UserRequestQueue { @@ -81,7 +81,10 @@ trait RequestHandlerS3 extends S3Client with UserRequestQueue { logger.info(s"Request sent to backend storage: method: {} uri: {}, {}", request.method.value, request.uri.toString(), request) Http() .singleRequest(request) - .andThen { case Success(r) => logger.info(s"Received response from backend storage: {}", r.status) } + .andThen { + case Success(r) => logger.info(s"Received response from backend storage: {}", r.status) + case Failure(exception) => logger.error("Backend error e={}", exception) + } .map(r => r.withEntity(r.entity.withoutSizeLimit())) }