Blog

This section contains articles migrated from my old Wordpress site.

Server-Sent Events with Nuxt.js (Vue.js) and Nginx proxy

Suppose you have a Nuxt.js (Vue.js) application which calls a backend and which is behind a Nginx reverse proxy. If your backend stream Server-Sent Events (SSE) using text/event-stream content-type, you may have these errors: 504 (Gateway Time-out) or ERR_INCOMPLETE_CHUNKED_ENCODING (in Chrome). If you want to make SSE works with your Nuxt.js application which is behind a Nginx reverse proxy, you have to do 2 things : Enable long running connections in Nginx Add these lines in your Nginx configuration:

November 30, 2017

Docker in Jenkins in Docker

You mad? Really, you should not do this. If you’re still here and want to do this, check this GitHub repository: https://github.com/damienbeaufils/docker-in-jenkins-in-docker You’ve been warned.

October 26, 2017

How to properly encrypt data using JPA converters and Spring Data JPA

TL;DR: all code is directly available on GitHub: https://github.com/damienbeaufils/spring-data-jpa-encryption-example Each time I want to encrypt entity fields values with JPA converters, I end up reading this blog post. This example is clear and functional, but has no unit or integration tests, and I thought the code could be more decoupled to avoid duplication when having multiple converters. So I wrote an example using Spring Boot and Spring Data JPA, with a User entity which have different fields: id (a Long), firstName (a String), lastName (a String), email (a String), birthDate (a LocalDate) and creationDate (a LocalDateTime).

July 21, 2017

Overriding a String List configuration key using Java System properties

With Play Framework, you can override configuration keys by specifying them as Java System properties. Example: activator run -Dsome.key="some.value" But if you have a String List key, you cannot override it like in the configuration file. Example using the trusted proxies configuration: activator run -Dplay.http.forwarded.trustedProxies=\["127.0.0.0/8","10.0.0.0/8"\] You will have this runtime error: Configuration error\[system properties: play.http.forwarded.trustedProxies has type STRING rather than LIST\] To avoid this, you have to specify each entry of the list using the entry index:

February 2, 2016

Implementing a SOAP client with CXF using Play Framework 2.x

TL;DR: if you want to skip the tutorial, all code is directly available on GitHub: https://github.com/damienbeaufils/soap-client-with-cxf-using-play EDIT June 2016: code on my GitHub repository updated for Play Framework 2.5! Play 2.4 version is still available here. I was working on a new client product, and I had to plug a web application built with Play Framework (and then sbt) to SOAP web services. How to do it? The need: be able to generate Java classes from one or many WSDL files, and use those classes with Play 2.

December 21, 2015
Nifty tech tag lists from Wouter Beeftink | Page content generated from commit: a47d7c1