Congrats Guido, sounds like you've done a great job. When the customer is happy... :-)
So that you know, there are a few of us using Scala with Maven. As someone who once suffered through Ant, I prefer the encapsulation of functional/procedural code in plugins. As you may know, the SBT plugin for IntelliJ needs to do a "build" with a special SBT plugin inserted in order to extract the build configuration, like Ant builds of yore, there's no way to reliably extract SBT configuration across versions without doing things this way. There's nothing wrong with that and it works, but my mind also thinks in this declarative way now about builds, so I tend towards Maven, XML and all. What I do is commit to starting one new project every year in SBT to see if I can make it "stick". There are some projects coming along like ScalaJS that probably won't have a Maven plugin for a long time since there's nobody to support it. That will be the kind of thing that will probably tip the scales for me. Like Scala and Akka, SBT has been coming along nicely and now that the "heavy lifting" patterns are established, there's time and experience to make it a more enjoyable and productive environment. If you're interested in a nice template for Scala, you might want to check out https://github.com/hseeberger/reactive-flows/ <https://github.com/hseeberger/reactive-flows/>. Heiko has done an stellar job of assembling all the best widgets for a clustered app with Akka-HTTP, including showing how to test with it. I've been banging on it to try to make the app more modular and in line with DDD patterns since it's already CQRS/ES friendly. If you get some free time, check it out! best, Brian > On Jun 16, 2015, at 1:14 PM, Guido Medina <[email protected]> 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/ <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 [email protected] > <mailto:[email protected]>. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > 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>. -- >>>>>>>>>> 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.
signature.asc
Description: Message signed with OpenPGP using GPGMail
