On the second day of this year’s JAX we dived into subjects like Spring, HTTP/2, Cloud and Performance.
Jürgen Höller (Pivotal) showed in his session ‘Modern Java component design with Spring 4.3’ the different annotations types in Spring 4.3. Starting with the known Spring 3.x annotations, he made his way to features of Spring 4.x and presented how you can combine them in a reasonable and ‘lean’ way. His take-away message was: There’s a lot about to come – you can already start looking forward to Spring 5!
Josh Long (Pivotal) aka #starbuxman presented Spring Boot in 60 minutes. 60 minutes, no slides! The room was filled to the last seat. In a 60 minutes high speed race, he set up a small application using Spring Boot and the features of https://spring.io/. Within a compact .jar he bundled embedded services using Maven for: h2, vadin and dropwizard. Using Spring annotations, the service was ’rounded’ within seconds. Starting and that was it! Simply great! 🙂 Take-away message: ‘Make .jar not War! It’s 2016 folks.’
In the talk ‘HTTP/2 and Java 9’ the main focus was on multiplexing and more parallelism. In comparison to HTTP/1.1 it is a lot more performant and has a higher throughput due to compressed data. The good news is: Upgrading from HTTP/1.1 to HTTP/2 is extremely easy. The only thing you have to do is erasing your 1.1 hacks. Servlet 4.0 will support HTTP/2. Java 8 is a precondition for HTTP/2. Tomcat 9 is currently in the alpha stage but the release candidate is supposed to be released soon – until then you might evaluate Jetty 9.3 as an alternative.
Thomas Lichtenstein (Mirantis) presented in his talk ‘OpenStack: Java development in a private cloud’ new deployment mechanisms within the OpenStack universe before one-click deployments – the vision of many Dev & Ops guys already became reality. You want a build server? ‘Click’ – Here it is….! In his talk, Tomas showed the possibilities of Heat, Docker, and Kubernetes in the OpenStack-Universe. At the end of his roadshow – even with bad mobile internet – he deployed a WebApp, which the audience could open via their smartphones. Take-away message: In this area the times of weeks and weeks of waiting time for provisioning of Nodes and Clusters are finally over!
We all know: Performance is an important topic in software development. No one wants to use software that is not responsive or require lots of memory. The talks covered subjects from processor concepts of parallel processing through high-performance list up to the performance testing. The java key word ‘synchronized’ is better than its reputation. Many new algorithms have been implemented and are constantly being improved. Synchronized blocks have higher performance than other locking mechanisms in Java (e.g. ReentrantLock). Developers should write more readable code than trying to use micro-optimizations via ‘correct’ ordering of commands because:
- The compiler will reorder the instructions (as long as he can prove that no side effects are created).
- The processor will reorder the instructions again.
When doing operations on lists, with more than just inserting items at the end of the list, it’s worth taking a look into third party libraries that are optimized for performance, such as the ‘Brownies Collections’. Unit tests are faster than system tests. So one should use them more intensively and not (mis)use system tests for testing small units of code. As the name suggests, they should be used for system testing. Take-away message: Make use of established tools / frameworks / libraries instead of trying to write everything by yourself. Because the more you do by yourself, the more you can do wrong.
Show all posts by Dimitar Robev