Re: [akka-user] akka-http is there an example of showing how to integrate with servlet container?

2018-01-02 Thread Brian Maso
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  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:
>
> 
>
>   Starter Servlet
>   servlets.StarterServlet
>   0
>
>
>   Starter Servlet
>   /*
>
> 
>
>
>
> 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  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 :

 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 akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 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  – Reactive apps on the JVM.
 twitter: @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 akka-user+...@googlegroups.com.
 To post to this group, send email to akka...@googlegroups.com.
 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/
> 

Re: [akka-user] akka-http is there an example of showing how to integrate with servlet container?

2017-12-27 Thread Feyyaz
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:


   
  Starter Servlet
  servlets.StarterServlet
  0
   
   
  Starter Servlet
  /*
   




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  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 :
>>>
>>> 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-servlet/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/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 akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> 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  – Reactive apps on the JVM.
>>> twitter: @rolandkuhn
>>> 
>>>
>>> -- 
>>> >> 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 akka-user+...@googlegroups.com.
>>> To post to this group, send email to akka...@googlegroups.com.
>>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] akka-http is there an example of showing how to integrate with servlet container?

2017-06-26 Thread Ilya Cassina
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  > 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 :
>>
>> 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-servlet/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/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 akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> 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  – Reactive apps on the JVM.
>> twitter: @rolandkuhn
>> 
>>
>> -- 
>> >> 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 akka-user+...@googlegroups.com .
>> To post to this group, send email to akka...@googlegroups.com 
>> .
>> 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] akka-http is there an example of showing how to integrate with servlet container?

2015-04-14 Thread Jas
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-servlet/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/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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] akka-http is there an example of showing how to integrate with servlet container?

2015-04-14 Thread Roland Kuhn
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 tomer...@gmail.com:
 
 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-servlet/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/ http://akka.io/docs/
  Check the FAQ: 
  http://doc.akka.io/docs/akka/current/additional/faq.html 
  http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user 
  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 akka-user+unsubscr...@googlegroups.com 
 mailto:akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com 
 mailto:akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user 
 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout 
 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/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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] akka-http is there an example of showing how to integrate with servlet container?

2015-04-14 Thread Jas
thank you! sounds like a good option considering my system is already 
integrated with tomcat!

On Tuesday, April 14, 2015 at 5:55:10 PM UTC+3, √ wrote:

 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 goo...@rkuhn.info 
 javascript: 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 tome...@gmail.com javascript::

 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-servlet/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/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 akka-user+...@googlegroups.com javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 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/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 akka-user+...@googlegroups.com javascript:.
 To post to this group, send email to akka...@googlegroups.com 
 javascript:.
 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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] akka-http is there an example of showing how to integrate with servlet container?

2015-04-14 Thread Viktor Klang
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 goo...@rkuhn.info 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 tomer...@gmail.com:

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