Using S3 libraries with Minio mock server

Minio WebUI

In the continuation of my previous S3 article,

I present you, how to write a S3 Java Sample program that is using a mock S3 server to develop the functionalities.

Continue Reading


Parallell issues with Java software : useful links to troubleshoot

Java 8 Threads/Promises/CompletableFuture/ForkNodePool

I am writing a new release of my Spring CQRS Module(link1, link2), including a parallel execution feature.

However I am encountering several issues with the Java 8 promises aka CompletableFutures.

My issues are :

  • I am using a dedicated ForkNodePool but some promises are stilled created outside my pool
  • Some threads are slow to die (WAITING state is too long)
  • Completable.allOf is creating promises in the common ForkNodePool
  • I had an exceeded waiting thread exception

Here is two links that are helping me a lot to solve these problems :

  • Java Parallel Calamity : link
  • The Java Fork/Join Framework : link2

These two articles are well documented and explain into the details how Java/Threads/Java/JVM/Promises and parallel streams works.


CompletableFuture and Java 8 Reactive

java completablefuture

I have bene using recently Java 8 new features CompletableFuture.

It works the same way as javascript promises but with a crazy hard to remember syntax and plethora of methods.

I found this great webpage to guide me through the API :

Guide To CompletableFuture

The result is this new version of the CQRS Module :


Fore more informations about that module, check there :


An example of code is here.


How to implement CQRS with Spring : new framework

This article is a presentation of a new little framework, I have developed and used on several projects.

The framework is for Spring Framework and requires Java 8.0. The code is on GitHub and downloadable from Bintray or JCenter.

Continue Reading


Writing an integration test with a mail server

This is a simple example of code to demonstrate how to use the library fakesmtp-junit-runner to write integration tests.

The library has been released on GitHub and Maven Central. Continue Reading


Togaf and Enterprise architecture interesting links 1

Today I have produced a short list of links interesting about Togaf and Entreprise architecture.

A nice quote :

{% blockquote Angelo Andreetto, Senior Enterprise Architect for Zurich Insurance Group in Zurich, Switzerland %} Digital transformation is a fantastic way to rethink Enterprise Architecture,

{% endblockquote %}

Here is the digest :

  • an interesting article explaining the limits of the Togaf methodology. here

{% blockquote %} People actually think that TOGAF must be right because it is a compendium, very large at that, of IT project good practices, because it has so many brand names behind, because of its many followers in IT, because of its many vocal backers whose interests are intertwined with TOGAF, because it has the dominant training and certification market share, because it has its own conferences. {% endblockquote %}

  • is Enterprise architecture completely broken ? post

This article is particularly interesting since it explains the limits of EA when this domain is understood as a basic documentation or a fixed organization.

{% blockquote %} EA fails when enterprises are treated as discrete systems that can be reduced into smaller problem sets, as traditional engineering approaches or some EA frameworks would have us believe. {% endblockquote %}

  • Agile, TOGAF and Enterprise Architecture: Will They Blend? article

"Is enterprise architecture still relevant when we do Agile?" and "what is the role of an enterprise architect in an Agile organization?" That the questions this article is trying to answer.

  • For people that are new with the concepts of Enterprise Architecture, this Microsoft MSDN page is useful. msdn

Indeed there is a comparison of the Top Four Enterprise-Architecture methodologies. Informations there are quite old (2007) though relevant. I am particularly fond of real battlefield experiences on using such methodologies. This article is a good start.

These slides illustrates how to implement TOGAF by delivering some key points, in particular the metamodel.

  • Togaf posters

This site offers some posters to have a better understanding of Togaf and the Enterprise Architecture Togaf posters

  • Enterprise Architecture by the example :

This document is an implementation of Togaf 9 by Birmingham University. It is full of samples and good informations to exploit 🙂 Birmingham Enterprise Architecture Framework

I am loving metrics and this article was really great : 7 Key architecture metrics – IT Total Cost of Ownership (TCO) as a Percentage of Revenue – Total Cost Savings (TCS) – Percentage Of Spend That’s Strategic (PSTS) – Common Services Compliance Rate (CSCR) – Architectural Due Diligence Rate (ADDR) – Sunset Technology (ST) – Business Specific

Finally to conclude a TOP 8 of Enterprise Architecture risks 8 Enterprise Architecture risks

{% blockquote %} If your Enterprise Architect can’t describe five cases where Enterprise Architecture has failed miserably, it is time to find a new Enterprise Architect. {% endblockquote %}

  • Security vulnerabilities and exposures : EA and security should work together to bring state of the art security in the whole company
  • Distracting critical staff : Stakeholders often complain that Enterprise Architecture is cumbersome
  • Low adoption rates : It is much easier to define a enterprise architecture than to implement the governance required to implement it.
  • Increasing solution costs : Enterprise architecture programs are often guilty of over-engineering.
  • Decreasing user acceptance : Users often complain that common solutions are less adapted to the needs of their business unit.
  • Creating dependencies : common solutions also introduce new dependencies between business units and can create new bottlenecks.
  • Project delays : it is possible for EA processes to delay projects and add excessive overhead by adding unnecessary checkpoints.
  • Be careful what you measure : if EA introduces business performance metrics, metrics may also introduces risks and weird behaviours.

Stop/Remove All Docker containers

Stop / remove all Docker containers

Hints to use with docker.

In the version 1.13.x and higher :

Remove all unused containers, volumes, networks and images (both dangling and unreferenced).

docker system prune

Link : doc docker

Removes all stopped containers.

docker container prune

Link : doc docker

Hack and hints

There are many ways to stop/remove all Docker containers.

 On Unix/Linux :

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)


docker rm -f $(docker ps -a -q)

For All images :

docker rmi $(docker images -q)

Remove all containers and volumes :

docker rm -v $(docker ps -a -q)

Stop faster docker images :

docker ps -a -q | xargs -n 1 -P 8 -I {} docker stop {}


FOR /f "tokens=*" %i IN ('docker ps -a -q') DO docker rm %i


docker rm @(docker ps -aq)

Link :


SonarQube and ReactJS

This article is showing you how to use SonarQube with ReactJS and its JSX files. I will use both SonarQube JavaScript plugin and the additional plugin Sonar EsLint plugin.

<%- toc(str, [options]) %>

For the people who has missed my previous article, I have created a new SonarQube plugin to extends the Javascript analysis.

Installation and Configuration

The first step is to download the plugin directly from Github here.

Download the plugin

Download the plugin

Find the latest release.

Find the latest release

Find the latest release

Copy it in your Sonar extension folder.

Copy the plugin

Copy the plugin

Restart the server

Restart the server by calling the commands (here on linux)

  âžś  sonarqube-6.0 ./bin/linux-x86-64/sonar.sh stop
  Stopping SonarQube...
  Waiting for SonarQube to exit...
  Stopped SonarQube.
  âžś  sonarqube-6.0 ./bin/linux-x86-64/sonar.sh start

 Enabling custom rules in SonarQube

Don’t forget to modify your SonarQube profile to enable the new ESLint rules :

Add the ESLint rules to your SonarQube profile

Add the ESLint rules to your SonarQube profile

Enable the ESLint rules to your SonarQube profile

Enable the ESLint rules to your SonarQube profile

Preparing your project

 Handling SonarQube Scanner

Most projects requires the SonarQube scanner (Wiki Link to analysis Javascript. Download it somewhere on your disk and unzip it.

Creates a file sonar-project.properties̀ into your project.

Copy-paste this content and modify it :

sonar.projectName=ReactJS demo

Don’t forget the line sonar.javascript.file.suffixes=.js,.jsx, it’s the hack to make SonarQube working on JSX files!

OK! SonarQube Scanner is configured!

Preparing ESLint

We want to perform the SonarQube analysis with the additional results of ESLint. Eslint is a popular linter that provides recent rules for many javascript frameworks – ReactJS included.

ESLint is thereby often upgraded and contains through its extension system, rules and frameworks that you won’t find in the regular SonarQube installation.

If you haven’t created yet an ESLint configuration file, here is the commands :

ESLint Configuration

ESLint Configuration

You can try the configuration by launching ESLint ony your project. It may warn you that some extensions are missing. Install them with NPM or Yarn.

Missing NPM Module

Missing NPM Module

Usually, the ReactJS extension is missing of your project. You can add them like developer extensions (--save-dev) or globally (-g).

Install missing ESLINT ReactJS extension

Install missing ESLINT ReactJS extension

With the right configuration and ESLint installation, the scan of a JSX File should work :

Scanning JSX File

Scanning JSX File

OK! ESLint is configured!

 Launching SonarQube Scanner

Launchs the SonarQube scanner with the command :


And the analysis is running …

âžś  react-jsx git:(master) âś— ~/tools/sscanner/bin/sonar-scanner
INFO: Scanner configuration file: /home/sleroy/tools/sscanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/sleroy/git/react-jsx/sonar-project.properties
INFO: SonarQube Scanner
INFO: Java 1.8.0_121 Oracle Corporation (64-bit)
INFO: Linux 4.10.0-21-generic amd64
INFO: User cache: /home/sleroy/.sonar/cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=211ms
INFO: User cache: /home/sleroy/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=14ms
INFO: SonarQube server 6.0
INFO: Default locale: "fr_FR", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=214ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=94ms
INFO: Load active rules
INFO: Load active rules (done) | time=897ms
INFO: Publish mode
INFO: -------------  Scan ReactJS demo
INFO: Load server rules
INFO: Load server rules (done) | time=482ms
INFO: Base dir: /home/sleroy/git/react-jsx
INFO: Working dir: /home/sleroy/git/react-jsx/.scannerwork
INFO: Source paths: src
INFO: Source encoding: UTF-8, default locale: fr_FR
INFO: Index files
INFO: 9 files indexed
INFO: Quality profile for js: Sonar way
INFO: Sensor Lines Sensor
INFO: Sensor Lines Sensor (done) | time=41ms
INFO: Sensor SCM Sensor
INFO: SCM provider for this project is: git
INFO: 9 files to be analyzed
INFO: 0/9 files analyzed
WARN: Missing blame information for the following files:
WARN:   * /home/sleroy/git/react-jsx/src/example/hello.jsx
WARN:   * /home/sleroy/git/react-jsx/src/example/index.jsx
WARN:   * /home/sleroy/git/react-jsx/src/fixtures/this.jsx
WARN:   * /home/sleroy/git/react-jsx/src/example/index.js
WARN:   * /home/sleroy/git/react-jsx/src/example/imager.jsx
WARN:   * /home/sleroy/git/react-jsx/src/fixtures/component.jsx
WARN:   * /home/sleroy/git/react-jsx/src/fixtures/advanced.jsx
WARN:   * /home/sleroy/git/react-jsx/src/fixtures/react.jsx
WARN:   * /home/sleroy/git/react-jsx/src/fixtures/hello.jsx
WARN: This may lead to missing/broken features in SonarQube
INFO: Sensor SCM Sensor (done) | time=504ms
INFO: Sensor XmlFileSensor
INFO: Sensor XmlFileSensor (done) | time=1ms
INFO: Sensor JavaScript Squid Sensor
INFO: 9 source files to be analyzed
INFO: 9/9 source files have been analyzed
INFO: Unit Test Coverage Sensor is started
INFO: Integration Test Coverage Sensor is started
INFO: Overall Coverage Sensor is started
INFO: Sensor JavaScript Squid Sensor (done) | time=893ms
INFO: Sensor Linting sensor for Javascript files
INFO: Sensor Linting sensor for Javascript files (done) | time=1438ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=38ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=2ms
INFO: Sensor CPD Block Indexer
INFO: DefaultCpdBlockIndexer is used for js
INFO: Sensor CPD Block Indexer (done) | time=1ms
INFO: Calculating CPD for 2 files
INFO: CPD calculation finished
INFO: Analysis report generated in 170ms, dir size=24 KB
INFO: Analysis reports compressed in 254ms, zip size=18 KB
INFO: Analysis report uploaded in 39ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/sleroy:reactjs-demo
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AVwHr7JyDHBkCqlFC7Sx
INFO: Task total time: 8.046 s
INFO: ------------------------------------------------------------------------
INFO: ------------------------------------------------------------------------
INFO: Total time: 10.141s
INFO: Final Memory: 48M/301M
INFO: ------------------------------------------------------------------------

Controlling the results

Go to your Sonar interface, and jump directly to the dashboard.

Our project has been analyzed.

SonarQube analysis

SonarQube analysis

We observe that the violation’s number is increasing with the new rules.

SonarQube analysis details

SonarQube analysis details

Hourra, our JSX files are analyzed !

JSX Analysis

JSX Analysis

In this article, we have installed, configured a new plugin to perform better Javascript analysis into SonarQube, working with ReactJS and JSX files.


Modularizing C/C+ Softwares

A presentation I made (in french) about how to modularize C/C++ Softwares and the various ways to implement it.

Here is the summary of the presentation.

Primary goals :

– How to scaffold a C/C++ Software ?
– What is the difference between a regular include directive and a system include directive ?
– Understand how the include directives works with CMake
– How to write appropriately a C/C++ header ?

Secondary goals :
– How to export symbol and definitions ?
– How to optimize dependencies between files
– How to generate precompiled headers
– Best practices to produce C/C++ modules

Here the full presentation:
[slideshare id=54013887&doc=rappelsmodularisationapplicationcc-151016091120-lva1-app6892]