Blog Posts

ElasticMQ – the SQS power available locally

Amazon Simple Queue Service (Amazon SQS) is a distributed message queuing service. It is similar to other well-known messaging solutions like RabbitMQ, ActiveMQ, etc. but it is hosted by Amazon. It is a really fast, configurable and relatively simple messaging solution. In my current company we strongly rely on the AWS infrastructure. One major Amazon cloud component we use is the SQS (Simple Queue Service). It allows us to decouple components in the application. We also send lots of notification through SQS

Continue Reading

How to make your Maven build fast again

When the project starts we do not think about the certain things like dependency hell, modularisation or time needed to build the project. It is quite normal, the codebase is pretty small, there are not that many dependencies, etc. However when the time is passing, the time spend on building the application starts to be noticeable. It is high time to think how to cut down on the build time. Here you can find a few tips which could help

Continue Reading

Goldman Sachs collections – nearly everything you want from collections in Java

Java collection framework is not that powerful as experienced Java developer would expect. For example, how do you sort a list? Simple answer would be to use java.util.Collections.sort() method with some kind of java.util.Comparator implementation. Additionally Guava Ordering support can be used. However, the solution is not exactly what object oriented developer looks for. Similarly to sorting a collection you would probably deal with finding min or max element in a collection using  java.util.Collections.min() and java.util.Collections.max() methods respectively. After all how to

Continue Reading

Intellij Idea without a mouse

I decided to write this post after watching Hadi Hariri’s talk at Geekout 2014 called “Mouseless Driven Development” According to Hadi, it is possible to code in Intellij Idea without even touching a mouse. I can believe it. In the post I am going to present some nice tricks which I use on my daily work with Intellij Idea and the new ones that I learned during the talk. Writing this post I was using Intellij Idea 13 so some of

Continue Reading

After the 33rd Degree 2014 – main tools/techniques to trial or adopt

Every conference I have attended so far left me with new ideas and motivation to do things better on daily basis. This year 33rd Degree has given me the same boost as the previous ones. This blog post is a quick overview of tools/techniques I am going to investigate deeper after the conference and try to introduce at least some of them at my daily work. Project Lombok boilerplate code generator some features: @NonNull annotation – generates null check for

Continue Reading

Measure and find bottlenecks before they affect your users 1/2

Inspired by a few talks during the last 33rd Degree conference I decided to implement, in one of the applications I develop, metrics which allow developers or operation team monitor running application and possibly detect potential problems early on. After a quick investigation I decided to use the Metrics framework. What I expected was exposing at least some statistics concerning usage of application components. First of all I would use them during application stress tests to find particular components slowing down the application. After

Continue Reading

Manage Node.js dependencies properly

Author of every piece of software bigger than simple “Hello World” sooner or later will face problem with dependency management. In this post I would like to consider that problem and possible solutions in regard to Node.js applications. In Node.js world managing dependencies with npm is exceptionally simple, however there are some caveats which everyone should be aware of. Have a look at example package.json file: [crayon-5970dce6a1345151943525/] Every package has a version number which comply with what is described as semantic

Continue Reading

Another useful tool from Zeroturnaround – Xrebel

Some time ago I signed up for a beta testing of a new tool from Zeroturnaround : Xrebel. I have been waiting a bit impatiently for a testing program to start. Finally I have got an information about availability of 1.0.0 version of the tool for download. Without much hesitation I have started tests. What does the tool do? As you may expect, based on previous Zeroturnarond tools, generally speaking it is intended to improve quality of Java developer every

Continue Reading

Hibernate + 2nd level cache bug

Recently, I have come across a nasty bug. When Hibernate executes a cacheable query and applying a ResultTransformer on a result of that query, java.lang.ClassCastException is thrown. [crayon-5970dce6a1a27701450156/] It seems that the ResultTransformer is applied on the result before putting it into cache. Cache expects Object list but it receives transformed results (in this case RateDTO list). It cannot deal with it and as a result exception is thrown. The bug is present in Hibernate 3.6.6.Final version. One of the workarounds

Continue Reading

Java enums + template method design pattern

Let’s consider the following code snippets: [crayon-5970dce6a1dc4346247009/]   [crayon-5970dce6a1dc9957025166/] How often do we see much the same scenario? It is not completely wrong since there is a try to use enums so it is not entirely “string driven” programming. However there is still a space to do some refactoring. What about doing such stuff more in the object-oriented way? Enums are very powerful Java feature but for most of the cases there are only used in the simplest possible way.

Continue Reading

Site Footer