Java Microservices with Spring

Java | Microservices | Spring Boot | Spring Cloud | Spring Integration | Google Cloud

Let’s make software development in Java enjoyable again with Microservices and Spring

Like the dinosaur, monolith had had its time too. Altought object-oriented programming was supposed to promote the component-based reusability and agile methodologies was supposed to facilitate fast development, that rarely works in practice. What happens (more often than not) within large, long-lived monoliths due to changing existing code constantly to keep the business doing, it that the business logic creeps into every layer, encapsulation looses its purpose and complex dependencies are being format between classes. That leads to three severe consequences.

icon1b

Slow development

With only one code base, development need to be carefully coordinated otherwise teams will block each other. Myriad of methodologies are out there to mitigate the bottleneck of having to work with a one code base, but in reality it does happen often that a single developer breaks the build and it then it breaks for everyone else.

icon2b

Increasing technical debt

Development always goes against the least resistance when a product needs to shipped on time in order to serve the business. What used to be well-designed and clean at the beginning, that becomes a mess quickly.

icon3b

All-or-nothing deployment

It doesn’t matter if only a single bug fix or an entire array of new features need to be shipped. That triggers a full deployment cycle. It either works or it has to be rolled back. But what about changes which cannot be rolled back than easily? Just think about database migrations.

Granted, the Microservices Architecture isn’t a silver bullet either and there are situations where going with a Monolith is better. Nevertheless, it’s worthwhile to weight the possible benefits against the possible challenges to solve.

Blog

Using Java Flight Recorder with OpenJDK 11

Java Flight Recorder (JFR) used to be a commercial add-on of the Oracle JDK. As it's been open sourced recently along with Java Mission Control, everyone using OpenJDK 11 can now troubleshoot their Java apps with this excellent tool for free of charge. JFR, being a proprietary solution formerly, might be lesser known for those relying on previous versions of OpenJDK. Therefore, [...]

Continue reading»

Consuming Twitter Streaming API with Spring Integration

1. Overview Spring Integration has been known to have a myriad of connectors for interacting with external systems. Twitter was no exception and for a long time, as Spring Social had been an out-of-the-box solution which Spring Integration leveraged in order to connect to social networks. 1.1 Spring Social EOL Unfortunately, Spring Social has reached its end of life, the pro [...]

Continue reading»

Installing OpenJDK 11 on Ubuntu 18.04 for real

OpenJDK 11 was released on the 25th of September, 1018. As this is the first LTS release after version 8, it's been awaited for long. After having it installed on Ubuntu 18.04 (Bionic Beaver), which comes with a package named openjdk-11-jdk, to my surprise that was still an earlier version (Java 10). [...]

Continue reading»

Bootiful GCP: Spring Cloud Stream with Google Cloud Pub/Sub

I've recently read Josh Long's Bootiful GCP series on Sprint Central's engineering blog and especially liked the 4th part about using Google Cloud's Pub/Sub. I felt inspired by the series and as I'm also evaluating Spring Cloud Stream for a new project of mine. I thought, I would expand on that article where Josh left off. This article describes how to use Spring Cloud Stream w [...]

Continue reading»

GDPR forget-me app (Part 3): Conditional configuration with Spring Boot 2

In the previous part I explained one of the messages flows in detail from the point of view of implementing in- and outbound messaging with Spring Integration's AMQP support. I briefly mentioned that data handler adapters are loaded dynamically and they're plugged into the message flow. In this third part, we’ll explore one of those technical challenges in detail that the ap [...]

Continue reading»

GDPR forget-me app (Part 2): Messaging with Spring Integration and AMQP

This second part focuses on how to use Java DSL for defining in- and outbound messaging with Spring Integration’s AMQP support. Java DSL is now (as of version 5) part of Spring Integration's core project and doesn’t have be included as a separate dependency. Altought sending and receiving messages to RabbitMQ doesn't necessarily appear to be complicated at a first glance [...]

Continue reading»

GDPR forget-me app (Part 1): Requirements

In preparation for the enforcement of GDPR which becomes final on the 25th of May 2018, I'm creating a simple, open source forget-me app for craftingjava.com in compliance with Art. 17 GDPR (‘right to be forgotten’). In the first phrase I'd like to support a simple forget-me process driven by the Scatter-Gather messaging pattern using Spring Integration and RabbitMQ, alth [...]

Continue reading»

Spring Boot 2.0 New Features: Infrastructure Changes

In my previous post, Spring Boot 2.0 New Features: The 3 Most Important Changes You Must Know About, I pointed out the one of the notable changes coming with Spring Boot 2 will be infrastructure updates. This post enumerates these updates so that you can see their impact once before you would upgrade. [...]

Continue reading»

Spring Boot 2.0 New Features: The 3 Most Important Changes You Must Know

As a Java Developer, you know that a lot had happened last fall: Java 9 got released, Spring 5 went GA, Spring Boot saw another four milestone releases. As a Software Engineer using Java for more then 12 years and a focus area on Spring Platform, I have found two presentations highlighting the most important aspects of the upcoming Spring Boot 2 release. [...]

Continue reading»

How to prevent OutOfMemoryError when you use @Async

Do you use @Async? You'd better watch out, because you might run into OutOfMemoryError: unable to create new native thread error just as I did. After reading this article you'll learn how to prevent it from happening. [...]

Continue reading»

How to consume large SQS messages with JMS and Spring Boot

Spring Boot became ubiquitous in recent years and provided an opinionated way of integrating various pieces of technology. Working with JMS is no exception to that. Altought Amazon has got it own Java API for interacting with SQS, using it through JMS ensures that we'll be able to use the same piece of code with another messaging infrastructure. After taking a look at a basic [...]

Continue reading»

Introduction to HTTP/2 support in Java 9

The IETF streaming group approved the HTTP/2 protocol in 2015, sixteen years after HTTP/1.1 had been released. HTTP/2 comes with the promise of lowering latency and makes many of those workarounds obsolete which were necessary for HTTP/1.1 in order to be able to keep up with today's response time requirements. In this article, I introduce HTTP/2 briefly and how it renews the t [...]

Continue reading»

Don’t want to miss a thing?

If you like Java and Spring as much as I do, you might consider signing up for my newsletters.