I'm still in the process of learning Scala, remember atm the project is 
written in Java 8, to be more provider dependent we are thinking to use 
Akka HTTP/Streams combined with AngularJS for such purpose.

About SBT, I'm not denying it is better than Maven but there was a strong 
time constrain so I had to deliver something with the tools at hand ;-)

On Wednesday, June 17, 2015 at 9:45:27 AM UTC+1, Anton Kulaga wrote:
>
> Why Maven? SBT is much better and flexible. Also, if you will decide to 
> add some scalajs code to frontend you will have to move to sbt anyway as 
> maven currently does not support scalajs
>
> On Tuesday, June 16, 2015 at 11:14:53 PM UTC+3, Guido Medina wrote:
>>
>> Hi,
>>
>> This is not exactly a question, more like a discussion and sharing some 
>> of my experiences lately, most of it for medium+ size companies might not 
>> make much sense but for overloaded small teams with one or two developers 
>> doing everything, here is my *-as short as I can describe it-* story:
>>
>> I was hired to continue developing a system, but such system was doing 
>> anything and the premise was to use X asynchronous framework *-won't say 
>> the name-* to build a high available and scalable system initially 
>> with several Maven projects and Eclipse.
>>
>> Everything looked perfect until I discovered the project was a 
>> green-field project with thousands of lines and it was not working so I 
>> decided to scratch it, first I had to convince management that Akka was the 
>> way to go and to do that I had 3 weeks to build a prototype that could 
>> deliver the basic functionalities so I had to make quick decisions and 
>> learn Akka while going:
>>
>>    - *Development environment:* No doubt, IntelliJ, I was willing to buy 
>>    it myself if they wouldn't, I'm not too fond of SBT so I'm doing 
>> everything 
>>    with Maven, my project is written in Java 8 but it has already the Scala 
>>    compiler so I can add Scala code if I want to, also IntelliJ Scala plugin 
>>    is good to look at API source code and stuff.
>>    - *Project structure:* Maven parent project with modules, a common 
>>    module for shared data structures, utilities and messages, a very minimal 
>>    number of dependencies, for example I was using Jackson Json but there 
>> were 
>>    like 4 jars so I switched to a lighter and smaller Jar - Gson.
>>    - *Execution:* Each module is just a Java main with an ActorSystem, 
>>    common.conf from common module dictates general config that are included 
>>    into each module_name.conf
>>    - *Akka cluster/remote:* The project was designed from the beginning 
>>    with location transparency and scale-ability in mind.
>>    - *Execution inside IntelliJ:* Easy because each module is just a 
>>    Java main.
>>    - *Maven profiles:* Help me create deployment options for different 
>>    environments like dev, test, uat, etc.
>>    - *Maven runners:* There is a mirror project which has the same 
>>    structure as the main project but it only acts as script builder and 
>>    application assembler to create easy executables using Maven app 
>> assembler, 
>>    due to all problems I have heard, I preferred not to use shaded nor fat 
>>    jars, instead something else generates the script (module_name.sh, 
>>    module_name.bat) for me so all I have to do is pass such scripts to IT 
>>    admin: http://www.mojohaus.org/appassembler/appassembler-maven-plugin/
>>    - *Location transparency and caches:* I have a sort of a address book 
>>    per module, each module instance subscribe to relevant cluster events and 
>>    when it does it knows *-by convention-* what supervisor it needs to 
>>    send a message to initiate the handshake, say a module named "strategy" 
>>    comes up, that module has the role "strategy" so I know at that node 
>>    address/user/strategy is a supervisor running, so I send my actor ref, 
>> once 
>>    it gets it, it sends to me his actor refs cache -children- and then I 
>> have 
>>    a local cache with addresses, so if I need to locate some account ID, I 
>>    just look up by Integer in my cache and I get an ActorRef, or I could 
>> look 
>>    for a round robin router because some components are load balanced so 
>> each 
>>    other supervisor keeps a round robin router updated.
>>    - *Dispatchers and mail boxes:* It wasn't easy to come up with a good 
>>    design initially, I was using the default dispatcher, now I have the 
>>    default dispatcher modified, a dispatcher for blocking operations, Netty 
>>    server and client pools customized, Kryo serialization 
>>    and SingleConsumerOnlyUnboundedMailbox, this is the aspect most of us 
>> will 
>>    spend most time, be ready for the inevitable consequences here, you will 
>>    play with these hundreds of times.
>>
>>
>> *Why did I make such decisions?*
>>
>>    - Time wasn't in my favor, I wanted to use something that just works, 
>>    and location transparency + cluster + local caches is doing a nice job 
>> for 
>>    me.
>>
>>
>> *What problems am I facing now?*
>>
>>    - Only few, now I have to build the UI of a system that it is running 
>>    in production making real transactions but I'm waiting on Akka HTTP's 
>> docs 
>>    for Java, yeah I know Scala is there but remember, time, Scala is on my 
>>    list and it is going to happen because I say so :D but not yet.
>>    - Akka remote is not behaving excellently but I expect that to 
>>    improve, fortunately my project required max time of 5ms and my system is 
>>    doing from 1ms to 4ms with a caveat, first few messages take 50ms and 
>>    eventually *-sooner rather than later-* it goes down to within 
>>    parameters.
>>
>> *Moving forward:*
>>
>>    - There were desperate moments because the old project took the 
>>    company 1 year plus the money spent and nothing was delivered so I was on 
>> a 
>>    very bad position, I didn't know this at the interview but I moved 
>> forward, 
>>    now management is very happy because magic happened, so thank you 
>> Typesafe 
>>    for producing Akka, it helped me focus on the business logic and not on 
>> the 
>>    technical details *-yeah, people who knows me will say, you, not 
>>    worrying about micro optimizations?-*, this time I needed something 
>>    that allowed me to be practical and fast and Akka did it.
>>    - Monitoring, I think we will go ConductR route, but still I need to 
>>    produce the rest of the system so that we can monitor *a system.*
>>    - AngularJS + Akka HTTP for REST and web sockets, because my project 
>>    is mainly beta, when I'm done I hope they are kind of optimized.
>>
>>
>> And now I will stop writing, it has been a long day *-the last 4 months 
>> every day has been a long day-*
>>
>> Hope this helps you when starting your Akka project, this also applies to 
>> Scala btw.
>>
>> I have been developing this project using a company's laptop which only 
>> has 8GB of RAM, spinning disk *-why not a SSD !!!-* and there I have to 
>> run IntelliJ + several JVMs + database so you will find Maven more 
>> beneficial than SBT for such purposes *-at least when using it built-in 
>> with IntelliJ-*
>>
>> *Note:* I'm a non-English native speaker so you will find some 
>> non-sense, more likely a bunch of ideas put together like a 
>> big Spaghetti plate.
>>
>> Best regards,
>>
>> Guido.
>>
>

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