Hi Feyyaz, I'm thinking what you'd have to do to stay within your organization's required JEE environment is to create a servlet that could feed messages to a Source.actorRef or Source.queue. based on whether you could use the servlet async API, or need to use the venerable synchronous servlet API, I think you could get a successful integration with Akka Streams without herculean effort.
It's no fun having to customize a framework the very first time you use it, or to have to create "shims" like this. But I'm sure you'd find the effort worth it. I have had a great amount of success using Akka Streams in several different projects -- speeding up development, simplifying testing, and getting reliable implementations as a result. I'd be happy to help with pointers, advice, and hints. Brian Maso On Wed, Dec 27, 2017 at 2:02 PM, Feyyaz <[email protected]> wrote: > Hi, > > I'm struggling the same issue as well. It's not a choice, but it's a > requirement from the infrastructure team. > > Unfortunately there is no way to directly bind it to a servlet. The > easiest way is, as @√ says, to start/stop it with servlet, but it will > run on a different port. For example, if your server runs on 8080, you can > will Akka-HTTP from 8081. > > You can use xsbt-web-plugin to create a servlet and package as a war file. > (by following the instructions at https://github.com/ > earldouglas/xsbt-web-plugin). > > After that, configure your web.xml to run your starter servlet on startup > as below: > > <web-app> > <servlet> > <servlet-name>Starter Servlet</servlet-name> > <servlet-class>servlets.StarterServlet</servlet-class> > <load-on-startup>0</load-on-startup> > </servlet> > <servlet-mapping> > <servlet-name>Starter Servlet</servlet-name> > <url-pattern>/*</url-pattern> > </servlet-mapping> > </web-app> > > > > On Monday, June 26, 2017 at 6:02:56 PM UTC+1, Ilya Cassina wrote: >> >> Hi √ and everyone, >> >> It's 2017 and I'm still struggling with this (migrating from spray)… >> >> Could somebody share the easy integration using ServletContextListener >> described above? >> >> In particular I'm quite interested in >> - how to use a generic servlet implementation backed up by a "routes: >> Route" created with akka-http. >> - how to pass what once was "spray.boot-class" parameter to the servlet >> or the servlet initializer. >> >> Thank you! >> >> Ilya >> >> >> Il giorno martedì 14 aprile 2015 16:55:10 UTC+2, √ ha scritto: >>> >>> One integration you can do easily is to have a ServletContextListener >>> that creates the Akka Http server endpoint when loaded and stops it on >>> unload. >>> >>> On Tue, Apr 14, 2015 at 3:53 PM, Roland Kuhn <[email protected]> wrote: >>> >>>> Hi Tomer, >>>> >>>> the servlet container way of running things completely negates all the >>>> benefits that Akka HTTP would give you, so there is no point in supporting >>>> this scenario—spray-servlet will not be ported to Akka HTTP. >>>> >>>> Sorry for the bad news, >>>> >>>> Roland >>>> >>>> 14 apr 2015 kl. 15:45 skrev Jas <[email protected]>: >>>> >>>> is there an example showing how to integrate servlet container with >>>> akka-http? i'm currently using spray with serlvet with >>>> https://github.com/spray/spray/blob/master/spray-servle >>>> t/src/main/scala/spray/servlet/Servlet30ConnectorServlet.scala and was >>>> hoping to find an example showing how to perform this with akka-http.. >>>> >>>> thanks >>>> >>>> -- >>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c >>>> urrent/additional/faq.html >>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou >>>> p/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. >>>> >>>> >>>> >>>> >>>> *Dr. Roland Kuhn* >>>> *Akka Tech Lead* >>>> Typesafe <http://typesafe.com/> – Reactive apps on the JVM. >>>> twitter: @rolandkuhn >>>> <http://twitter.com/#!/rolandkuhn> >>>> >>>> -- >>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/c >>>> urrent/additional/faq.html >>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou >>>> p/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, >>> √ >>> >> -- > >>>>>>>>>> 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 https://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- >>>>>>>>>> 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 https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
