Akka

Something else I picked up at Devoxx is Akka. I had heard of it before. Following a session about it renewed my interest.

Akka is a framework created to address problems in creating highly scalable and concurrent software. It is also the name of a mountain in Sweden and a Goddess.
Akka’s Keywords are: concurrency, scalability, fault-tolerance
Akka tries to address system overloads and is currently used in finance, telecom simulation, e-commerce and betting system. All applications that need a lot of event driven actions.
If you have heard of the Play framework, it will be using Akka internally from 2.0 on.

An Akka application uses Actors. What’s an actor: an object that encapsulates state and behaviour. Actors talk to each other as like they send mail. They don’t wait for each other. ( e.g. an actor could be every user in a mmorpg)

Some actor features: Continue reading “Akka”

Stop sleeping, start awaiting

On Devoxx there was a quicky session named ‘Stop sleeping, start awaiting’

The speaker presented Awaitility. A test-framework for helping you out waiting on objects. Mainly usable for testing asynchronous code in unit testing. A unit test does not wait for code to be executed, developers tend to use Object.sleep(xxx) but this will not always work. On some systems the xxx needs more milliseconds then on others. In the end you’ll be waiting ( rather sleeping) while all the tests that have sleep() run. The whole testsuite will go very slow.

Awaitility is a framework to help you wait for code to be executed,
It goes like:

await().untilCall(wrappedCallMethod).statusOf(xxx).is(OKAY);

It’s like a mocking framework. Personally I do the same with mockito and java.util.concurrency waiting and locking classes. But perhaps Awaitility will make you create the tests faster.

This is certainly one framework I will try out!

JRebel Rocks

After working for iText for nine months, I’ve now turned back to consultancy and the web application world.

The web application I’m working in is rather big and redeploying takes time. Luckily the JRebel guys were so friendly to offer me a 3 month license. I hope this three months is enough to convince the guys at my current job location that investing in JRebel is really worth it’s money! (1 week should be enough to convince them, look at the time savings for 2 days down here)

Look what JRebel did:

Over the last 2 days JRebel prevented
at least 79 redeploys/restarts saving you about 3.2 hours.

Otherwise:

Oct 17, 2011 11:44:56 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 210210 ms

Of course during the time of restarts/redeploys you can do other stuff, thus the 3.2 hours is not really the saved time. ( I would say 1.6 would be more realistic.)

What does JRebel do?

JRebel reloads the changed classes and files inside your container. Thanks to this you don’t need to restart and/or redeploy for every change you make. You can instantly see what changed. It even watches your spring configuration, logging configuration, your defined properties files and more for changes and applies the changes to your environment without the need to restart.

I can only say: “Once you go JRebel you never want to go back without it!”