Hi Filippo,
In order to run servlets you'd have to implement a proper servlet
container. Akka Http does not aim to implement servlet spec.
The reason is that the servlet specification has very strict requirements
on threading etc. which does not fit reactive systems very well.
For example servlets heavily rely on the 1-thread-per-request model, and
even given the new spec version 3.1 in which async servlets are introduced
it is still rather rough and very simple to get wrong (as user),
so it is not something we aim to support (unless there is significant
commercial interest).

Perhaps it would be possible to hack something together that works "most of
the time" quickly, but at some point you'd bump into that the servlet code
expected something as in accordance to the spec,
yet the bridge is just a simple hack and things would go wrong...

PS: Spray was able to run *inside* a servlet container, but not *host*
servlets. In that scenario you basically lost all good what spray would
have given you. It is also not something we aim to implement in akka-http -
"why lose all the goodies"?


On Thu, Jul 2, 2015 at 12:00 PM, Filippo De Luca <[email protected]>
wrote:

> Hi,
> I am working on a project that has some legacy code based on the Servlet
> API. I would like to transition to an akka-http based project. My idea
> was to define a route like this:
>
>    val route = newRoute ~ legacyRoute
>
> In wich legacy route will wrap the servlets in some way. Is it a doable
> approach and is there anyone has done something like that, maybe with a
> different approach? A route is a RequestContext => RouteResult at the end
> of the day, so I think will be not difficult to wrap the servlet service
> inside that. The complex part I think is to pass an implementation of
> ServletContext, ServletHttpRequest, and ServletHttpResponse.
>
>
>  --
> >>>>>>>>>> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Cheers,
Konrad 'ktoso' Malawski
Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to