0

We are migrating our application from spray to akka-http. We have a requirement to fetch few attributes from HttpServletRequest (set by filters).

Spray has a provision to extract HttpServletRequest by setting spray.servlet.servlet-request-access to on, like:

def httpServletRequest(requestContext: RequestContext): Option[HttpServletRequest] = {
  requestContext.request.headers collect { case ServletRequestInfoHeader(hsRequest) => hsRequest } headOption
}

However, I couldn't find similar provision in akka-http. Is there a we can acheive this in akka-http?

Update:
As per AKKA-http deployment, spray-servlet is not yet ported to akka-http, and akka runs on embeded webserver. Where as our application runs on Tomcat, So we need to wait for sometime to use akka-http on tomcat.

Chenna Reddy
  • 2,241
  • 18
  • 17

1 Answers1

1

spray-servlet is not yet ported to akka-http

Don't hold your breath. The Akka team didn't port over the spray-servlet module to Akka HTTP, because servlet containers don't fill well with the reactive approach to which Akka adheres.

Jeffrey Chung
  • 19,319
  • 8
  • 34
  • 54