Hi Francois:

I've integrated Akka into a couple of applications after the fact.

One integration was adding a caching layer over a database.  It is written 
up 
here: 
http://doc.akka.io/docs/akka/2.3.4/scala/howto.html#case-study-an-auto-updating-cache-using-actors.

In another application I added group membership and leader election using 
Akka clustering, and work distribution using the algorithm in "Balancing 
Workloads Across Nodes" described in 
http://doc.akka.io/docs/akka/2.3.4/scala/howto.html#balancing-workload-across-nodes.

Both times the integration was straightforward - just create the actor 
system and top level actors when the application starts up, and provide an 
API to send / receive messages to specific actors.

-- Eric

On Friday, October 31, 2014 9:33:45 AM UTC-4, Akka Team wrote:
>
> Hi Francois,
>
>
>
> On Thu, Oct 30, 2014 at 11:36 PM, Francois <fan...@gmail.com <javascript:>
> > wrote:
>
>> Hello everybody,
>>
>> I want to add Akka to an existing scala web application (not play), and
>> I'm wondering how it could be best achieve. The goal for now is not to
>> build a fully distributed and fault tolerant system, but to introduce
>> Akka at some point in the application and let its use grow, allowing to
>> set clear bound in that application and define subsystems.
>>
>> A nice and solution would be to  have a new application in Akka side by
>> side with the legacy one, providing new services or REST endpoint or
>> something.
>>
>
> This is one option. You can also embed an ActorSystem in other 
> applications and you might be able to expose a Future based API to its 
> external collaborators. In this case Akka would not communicate 
> "over-the-wire" but in JVM.
>  
>
>> But I prefer to not investigate that solution for now and try to
>> understand how Akka can be incorporated into an existing app. I'm
>> particulary intersted into knowing how 1/ Akka boot in that case and 2/
>> how to deals with the bound between actors and legacy code.
>>
>
> Akka does not need any special thing to boot. You can just create an 
> ActorSystem instance and it starts. You can even explicitly pass in a 
> Config object if you want to fully control how it gets its initial 
> configuration. 
>  
>
>>
>> For 1/, http://doc.akka.io/docs/akka/1.3.1/scala/http.html seems to be
>> the correct resources. Is there other example or documentation on the
>> subject ? (I didn't find many other intersting one, any help would be
>> appreciated).
>>
>
> That is a very outdated link since it refers to Akka 1.3.1 which is very 
> old now. Some of the current frameworks for HTTP related work are:
>  - Play (playframework.com) which can be used as a REST endpoint, but 
> generally geared towards Web development
>  - Spray (spray.io) which is built on top of Akka and integrates easily 
> with Akka. Best used for REST endpoints
>  - Akka Http which is Spray ported to the new Akka Streams infrastructure. 
> This is currently pre-experimental and the docs are sketchy right now. Also 
> we change the API very aggressively in every 2-3 weeks 
>  
>
>>
>> I thought it could be linked to
>> http://doc.akka.io/docs/akka/2.3.6/scala/typed-actors.html.
>
>
> Typed actors are no longer recommended, we will eventually phase them out. 
>  
>
>> Is it
>> correct ? If so, is there any ressources demoing a more complexe
>> integration ? Because I'm not sure how I implement my actor subsystem
>> from the typed actor boundaries with the legacy app.
>>
>> Thanks for any help or pointer to ressources !
>>
>
> As a very first step you should read the documentation (
> http://doc.akka.io/docs/akka/2.3.6/scala.html?_ga=1.228976988.1520294582.1409309043)
>  
> especially the Introduction, General and Actors sections.
>
> There is also a list of books that can be helpful: 
> http://doc.akka.io/docs/akka/2.3.6/additional/books.html
> (although some of them might be about earlier Akka versions, but 2.2 and 
> 2.3 are sufficiently similar)
>
> -Endre
>  
>
>>
>> --
>> Francois ARMAND
>> http://rudder-project.org
>> http://www.normation.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 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.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
>  

-- 
>>>>>>>>>>      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.

Reply via email to