elk logstash elastic parsing data

Structuring data with Logstash

Given the trend around microservices, it has become mandatory to be able to follow a transaction across multiple microservices. Spring Cloud Sleuth is such a distributed tracing system fully integrated into the Spring Boot ecosystem. By adding the spring-cloud-starter-sleuth into a project’s POM, it instantly becomes Sleuth-enabled and every standard log call automatically adds additional data, such as spanId and traceId to the usual data. 2016-11-25 19:05:53.221 INFO [demo-app,b4d33156

elk logstash elastic debugging

Debugging hints for Logstash

As a Java developer, when you are first shown how to run the JVM in debug mode, attach to it and then set a breakpoint, you really feel like you’ve reached a step on your developer journey. Well, at least I did. Now the world is going full microservice and knowing that trick means less and less in it everyday. This week, I was playing with Logstash to see how I could send all of an application exceptions to an Elasticsearch instance, so I could display them on a Kibana dashboard for analy

spring boot spring framework spring cloud sleuth post-processor convention over configuration

Another post-processor for Spring Boot

Most Spring developers know about the BeanPostProcessor and the BeanFactoryPostProcessor classes. The former enables changes to new bean instances before they can be used, while the latter lets you modify bean definitions - the metadata to create the bean. Commons use-cases include: Bootstrapping processing of @Configuration classes, via ConfigurationClassPostProcessorResolving ${…​} placeholders, through PropertyPlaceholderConfigurerAutowiring of annotated fields, setter methods and

continous integration travis github code coverage codecov

Travis CI tutorial Java projects

As a consultant, I’ve done a lot of Java projects in different 'enterprise' environments. In general, the Continuous Integration stack - when there’s one, is comprised of: Github Enterprise or Atlassian Stash for source version control, Jenkins as the Continuous Integration server, sometimes but rarely Atlassian Bamboo, Maven for the build tool, JaCoCo for code coverage, or even Artifactory as the artifacts repository - once I had Nexus. Recently, I started to develop Kaadin, a Kotlin

dsl

Easy DSL design with Kotlin

In Android, every tutorial teaching you the basics describe how to design screen through XML files. It’s also possible to achieve the same result with Java (or any JVM-based language). Android screen design is not the only domain where XML and Java are valid options. For example, Spring configuration and Vaadin screen design allow both. In all those domains, there’s however a trade-off involved: on one hand, XML has a quite rigid structure enforced by an XML-schema while Java gives po

microservice Spring Framework Spring Cloud Kotlin HTTP monitoring Sleuth

HTTP headers forwarding in microservices

Microservices are not a trend anymore. Like it or not, they are here to stay. Yet, there’s a huge gap before embracing the microservice architecture and implementing them right. As a reminder, one might first want to check the many fallacies of distributed computed. Among all requirements necessary to overcome them is the ability to follow one HTTP request along microservices involved in a specific business scenario - for monitoring and debugging purpose. One possible implementation of it

design API extension function

Extension functions for more consistent APIs

Kotlin’s extension functions are a great way to add behavior to a type sitting outside one’s control - the JDK or a third-party library. For example, the JDK’s String class offers the toLowerCase() and toUpperCase() methods but nothing to capitalize the string. In Kotlin, this can be helped by adding the desired behavior to the String class through an extension function: fun String.capitalize() = when { length < 2 -> toUpperCase() else -> Character.toUpperC

typesafe

Type-safe annotations

I don’t like dynamically-typed languages - scripting languages in other terms. Of course, I’ve to live with Javascript because it’s so ubiquitous on the web, but given the chance, I’d switch to TypeScript in an instant. I was amazed by a demo of the Griffon GUI framework, and have read some pretty good stuff about the Spock testing framework, but I barely looked at them because they are based on Groovy, a scripting language (even if it offers optional enforcement of types