Load Testing Web Applications with Gatling and Maven

I have written about other performance testing tools for web applications before. Nevertheless I’d like to demonstrate a library for load testing web applications named Gatling in combination with the build tool Maven. Gatling offers a nice Scala DSL, high performance using Akka, Netty and asynchronous IO and plug-ins for all modern build tools. In the following tutorial I’m going to show how to record simulations using an HTTP proxy, rewriting simulations in Scala and running and reporting simulations with Maven. ...

May 6, 2016 · 5 min · 1064 words · Micha Kops

Dynamic Configuration Management with Netflix Archaius and Apache ZooKeeper, Property-Files, JMX

Though having written about other configuration management libraries for Java before, I would like to demonstrate another one today: Netflix Archaius. Archaius offers some nice features like dynamic typed properties, thread-safe operations, an event system for property changes/updates, a JMX MBean to read and update properties and adaptors for a variety of dynamic configuration sources like Amazon DynamoDB, JDBC, URLs and Apache ZooKeeper. In the following tutorial I’d like to demonstrate how to read and update application configuration properties with Archaius and data sources like property-files, system-properties, JMX and Apache ZooKeeper. ...

April 13, 2016 · 4 min · 713 words · Micha Kops

Setting up an OAuth2 Authorization Server and Resource Provider with Spring Boot

OAuth2 is a frequently used standard for authorization and with Spring Boot it is easy to set up authorization and resource server in no time. In the following short tutorial I’d like to demonstrate how to set up an OAuth2 authorization server as well as a connected and secured resource server within a few minutes using Java, Maven and Spring Boot. Figure 1. OAuth2 Flow with Spring Boot in Action...

March 13, 2016 · 6 min · 1125 words · Micha Kops

Generating JUnit Tests with Java, EvoSuite and Maven

Generating test suites for existing code allows us to verify the behaviour of an application before we’re making changes to its code base or for regression testing. In the following short tutorial I’d like to demonstrate how to derive test suites from an existing Java application using EvoSuite and the EvoSuite Maven plug-in. EvoSuite offers some nice features like running in a sandbox to avoid dangerous operations, virtual file-system and network and optimizing of different coverage criteria. ...

February 28, 2016 · 5 min · 962 words · Micha Kops

Mocking HTTP Interaction with Java, JUnit and MockServer

When writing tests for our software components sometimes we need to mock external services based on the HTTP protocol, might it be a RESTful web-service, an XML-RPC call or a simple GET request to some web-server. In the following short tutorial I’d like to demonstrate how to create a mock HTTP server for testing and how to bootstrap and bind it to the life-cycle of a classical build-management tool like Maven. ...

January 5, 2016 · 4 min · 821 words · Micha Kops

Reactive Programming: Handling Service Timeouts and Retries with Retry4j

The Reactive Manifesto specifies responsive, resilient, elastic and message-driven as attributes for a reactive application. When implementing specific mechanisms to achieve this requirements, we often need to deal with timeout and retry-operations in our application and depending on our setup and environment, different tools and libraries exist to help us here. In the following short tutorial I’d like to demonstrate how to handle exceptions and operation retries on service boundaries with a lesser know, slim library named Retry4j. ...

December 2, 2015 · 3 min · 529 words · Micha Kops

Quick Mobile Application Prototyping with Ionic Creator

When it comes to the field of hybrid mobile application development, Ionic and its tool-stack is often an attractive choice. Now there is Ionic Creator to speed up the development process offering an in-browser editor to create user interfaces via drag and drop and supporting basic templates for mobile applications like tabbed layouts etc. In addition, a project created with this tool may be downloaded and started with easy and that’s what I’d like to show in the following short example. ...

November 17, 2015 · 3 min · 638 words · Micha Kops

Unix-like data pipelines with Java 8 Streams and UStream

We all love the simplicity when chaining commands and pipes in an Unix derivative environment. UStream takes this approach and extends Java 8′s stream API to mimic some of the well known commands and apply them on streams. In the following tutorial, I’d like to share some slim examples for using UStream. Figure 1. Data pipelines with UStream Dependencies We simply need to add one dependency to our pom.xml (using Maven): io.github.benas:ustream:0.2 ...

November 8, 2015 · 4 min · 659 words · Micha Kops

Creating REST Clients for JAX-RS based Webservices with Netflix Feign

For us developers there plenty of libraries exist helping us in deriving and generating clients for existing RESTful web-services and I have already covered some of the in this blog (e.g. the JAX-RS Client API). Nevertheless, I’d like to share my experience with another interesting lightweight library here: Netflix Feign. Feign offers a nice fluent-builder API, a rich integration for common libraries and APIs like JAX-RS, Jackson, GSON, SAX, JAX-B, OkHttp, Ribbon, Hystrix, SLF4J and more and last bot not least, it is setup easy and the service contracts are specified using interfaces and annotations. ...

October 22, 2015 · 6 min · 1138 words · Micha Kops

Using Deferred Objects and Promises with Java 8 and JDeferred

Promises may help us when dealing with asynchronous code and we need to merge, pipe or track the progress and the results of single parts of computation in our applications. In the following tutorial I’d like to demonstrate a small library, JDeferred that helps us for this specific use case. Figure 1. JDeferred examples running in Eclipse IDE. Dependencies Using Maven here, we simply need to add one dependency for jdeferred-core to our pom.xml: ...

September 27, 2015 · 8 min · 1631 words · Micha Kops