BOM stands for Bill of Materials. Basically we can use it to store in one place all the dependencies with their versions. It's useful in the case microservices are used to make sure same versions are used everywhere. Of course this is not necessarily a requirement for microservices, as you have the choice to build… Continue reading Maven BOM
Profiling with Spring
Every application should have functional and non-functional tests. Non-functional include load and performance. So what happens when we do not meet the performance requirements? Obviously we try to figure out what is going on. This is called profiling. In this post I will write about how to profile an application with spring. Profiling an application… Continue reading Profiling with Spring
Domain driven design concepts
Lately I've been fascinated by the idea of domain driven design. Before diving more deeply into it we must understand the concepts that are being used. Entities Each object should be uniquely identified. The entity should contain those attributes that are required in order to uniquely identify the object. For example for a Car the… Continue reading Domain driven design concepts
How many exceptions?
We all know what exceptions are. We have checked and unchecked exceptions in java. Checked exceptions are for recovering. Like reading a file from disk. public class ReadFile { private AtomicInteger retryCount = new AtomicInteger(0); private static final int maxRetries = 3; private static Logger log = getLogger(ReadFile.class.getName()); private String readFromFile(String fileLocation) { StringBuilder resultStringBuilder… Continue reading How many exceptions?
(Bad) Business kills coding
We're all in this because we love to code. The code has no feelings, it is real and quantifiable. We want to write the best code possible, to be proud of it. We follow the principles and realize great things. We refactor it times after times. Then unit and integration tests come along. Static analysis… Continue reading (Bad) Business kills coding
Sagas in microservices
We all know that the shared data in microservices(if they are done right) is eventually consistent. This is due to the CAP theorem which states that availability is usually a better choice than consistency. In a previous post I wrote about having eventual consistency data using Eventuate. Since distributed transactions(2PC) are heavy with a bad… Continue reading Sagas in microservices
Code review flavors
I have seen lots of people who are doing code reviews and others who think it's just waste of time or they are not convinced about it. The latter are probably defensive and don't want for others to tell them how good or bad is their code. And most probably they don't write any kind… Continue reading Code review flavors
Testing microservices
Now the fun part. Assuming that we have built a running microservice environment, how can we maintain it? How do we introduce changes without breaking it? How do we test it? We know we can do end to end tests, but these are slow and we need faster feedback. How can we test the microservice… Continue reading Testing microservices
Mockito 2
As Junit 5 was released in order to be able to use mocks you need to add the mockito extension. You noticed that ClassRunners are deprecated now in Junit 5, they were replaced with extensions, hence the Mockito Extension. What changes are in Mockito 2? Well one of the most important one is the change… Continue reading Mockito 2