October 29, 2015

Taming asynchronous JavaScript with Promises

If you've ever written some non-trivial code in JavaScript, then you have already embraced the AJAX world. You also know that AJAX is the future of Web app development.

Javascript asynchronous

Thus, if you work with AJAX libraries, then you've already queried exposed API endpoints in an asynchronous way. Asynchronous means that function calls and operations don’t block the main thread while they execute.

Let's have a look at one example, where we want to query an API with the adverts of a user, and then render them. This could look like the following example:

October 20, 2015

Testing Apache Camel Applications with Spring Boot

In a previous blog post my colleague Rene Schakmann has shown that Apache Camel is a versatile tool that integrates different components using well-known enterprise integration patterns. At willhaben, we use Apache Camel together with Spring Boot for many different projects. However, writing unit tests for these Camel routes is not that trivial and requires some knowledge of both frameworks. In this blog post, I will walk you through a sample project (available on github) with special regard given to testability.

Setup and configuration

The project is a pretty standard Java Maven project. In order to be able to properly write unit test, we need to use some dependencies (see pom.xml). Apart from the usual Camel and Spring Boot dependencies, the most important ones are:

October 14, 2015

Resilient Software Design

Software design and architecture have to meet a lot of non-functional requirements: accessibility, certifications, testability and maintainability – just to name some of them. In this article, we will look at resilient software design: it addresses, of course, the requirement of resilience but also availability.

Availability is one of the most important aspects if your business depends on your website to be up and running. If the website is down for one hour you are not earning anything in this time.  Formally spoken, availability is defined as a relationship between MTTF (Mean time to failure) and MTR (Mean time to recovery):

In former days it was quite easy: there was one monolithic system. If you wanted to achieve 99% uptime, you just had to make sure that your system achieved exactly this availability rate. This meant that you would have about 87.6 hours a year downtime, e.g. for maintenance, which is quite easy to handle.