Author Archives: Samir Čauš

About Samir Čauš

Samir Čauš is working as a Java developer at Five Minutes Ltd.

Introducing Spring Integration

Spring Integration

Recently, we worked on a project that required frequent polling of database table, processing each row, and writing output to different database table(s). The data tables are incoming and outgoing sms messages, and load would get quite high sometimes. We also had to support load balancing. Since our services are already done with spring – the choice was to try Spring Integration.

Read more

Leave a comment · Posted in Blog

Logging custom parameters with log4j

One important thing that needs to be setup early in every development process is logging. If you are using log4j , you have to set up properties file(s) and define Loggers, Appenders and Layouts. According to documentations “These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported”.
Read more

Leave a comment · Posted in Blog

Solving the text hell

I worked on several projects that had lots of problems with how they handled texts. Especially the problem was more expressed in bigger projects that had several teams working on them. The problem usually comes from process – who defines text key naming convention, do developers follow these convention, who writes and translates texts, how are frequent change requests from customer handled, internationalization etc… Some projects end up having lots of unused text keys, and perhaps some text values are not even defined. The one problem I run into is having almost same key value pairs in same property file, the only difference being case of one letter of text key.
Read more

Leave a comment · Posted in Blog, Java, Technology

Logging with Spring AOP

Aspect Oriented Programming allows you to “define cross-cutting concerns that can be applied across separate, very different, object models”. AOP complements Object Oriented Programming by increasing modularity with applying common behavior to multiple non-related object models. Basically, think about AOP as an interceptor for method calls, where you can add extra functionality.

Spring AOP is one of the key components of Spring Framework. It is very easy to start with, and can be used for getting complicated things done very easy. For example, Spring Transactional Management is made possible using Spring AOP.

Here you will see how to add logging of method calls with Spring. On every call you can log method name, method arguments, returned object, as well as method execution time. So you can use AOP as a profiler, where you can check where are the bottlenecks of your application.
Read more

1 Comment · Posted in Blog, Java