Author Archive: Drazen Nikolic

HikariCP

Fast, Faster, HikariCP

When it comes to application performances, bottlenecks like waiting too long for a specific page to load or triggering an API call which never returns – are easy to spot. In those cases it is obvious where problems are and where most of the execution time was spent. Of course, it is totally different thing, will you be able to resolve the noticed performance issues or not.

On the other side, there are many places in the application where time can be spent. Some used tools and libraries we take for granted and do not expect our logic is spending significant time running within them. This is a story about one specific case, in which application logic takes a lot of time to execute and how a simple change using HikariCP helped to cut the execution time in half.

Read more…

Still using java.util.Date? Don’t!

Java 8 was released 3 years ago (March 2014) and brought a lot of language improvements. One of those is new Date and Time API for Java, also known as JSR-310. It represents a very rich API for working with dates and times. Yet, I see many developers still using good old java.util.Date and java.util.Calendar classes in the code they write today.

Sure, we still have to interact with legacy applications and old APIs, using mentioned classes. But this does not mean we can not use new java.time API when writing new code or refactoring the old one. Why we would like to do so? Well, using the new API is simpler, more straightforward, flexible, easier to understand, classes are immutable and hence thread safe… just to mention a few.

Read more…

Analyze web server logs on the fly with GoAccess

There are times when you get urgent ping from you customer or hosting provider operations team. They complain about significant drop in application performances. Or that something is eating all the available server bandwidth or similar. The reasons for those problems could be various. If application logs and metrics showing normal behavior, before digging deeper, it is a good idea to exclude “external factor” first. GoAccess could get very handy in this situations, to analyze web server logs on the fly.

Ream more about how to use GoAccess

Effortless email testing with FakeSMTP

Each web application today sends some emails out. Those could be various information, reports, notifications etc. Sooner or later you will get a task to prepare and send an email. There are different ways how you can code the logic for generating email messages. What can sometimes be a bit cumbersome is testing this logic during development.

There are three major concerns, when it comes to email testing. One is configuring the right SMTP server, which is reachable, can talk with the application and takeover the sent email. Second is making sure that no test email reach real users, because nobody likes to be spammed (one could easily become confused, or even angry). The last one is taking care that your SMTP server does not get blacklisted, which can happen if you send a lot of funny “test 123456” emails out to the internet. Little tools like FakeSMTP could get very handy in resolving those concerns.

Read more about how to use FakeSMTP

Parameterize Hybris ImpEx import by config data from local.properties

SAP HybrisThere are times you have to parameterize data which is being imported by Hybris ImpEx import. One example could be handling of environment specific parameters, like different development and production endpoints URLs of a particular interface etc. A solution is to use Hybris ConfigPropertyImportProcessor in .impex file.

Read more about how to use config parameter in impex file

proper method naming matters

Proper Method Naming does Matter

We all have taught to choose good names for methods in the code we write. There are various coding style guides which set some ruling around method naming conventions and best practices. Although we tend to follow those in most cases, many times we forget to think will somebody else would be able to completely understand what method really does, by reading method name. Or, will our future self be able to clearly know the purpose of the method by reading this method name in 3 months after we wrote it. This is a short story about learning the hard way that proper method naming does matter.

Read more how we speeded up out our code by 95%

Devoxx

Devoxx Poland 2015 – Java Conference Summary

There are a lot of interesting tech conferences in 2016. If you want to stay up-to-date with the technology you are developing with (and you have available time and budget), there is some conference out there for you. Just do a simple google search to explore the possibilities. If you are quick enough in making up your mind and registering for a particular conference, you will most probably be able to get an early bird discounts. Last year I’ve visited Devoxx Poland in KrakowDevoxx is an annual European Java, agile, mobile and web conference. It was originally created by Belgian Java User Group. Last year the conference took place in Belgium, UK, France, Poland and Morocco. Many top industry speakers were talking about interesting topics. More than 10.000 developers visit those conferences annually.

Although it’s usually possible to watch all the presentations online (even for free), visiting a conference gives you some additional perspectives. One example: every day we got used to work in a team with some 5-10 other good Java developers. Just imagine how you would feel when you are at the same place with e.g. 2000+ other Java guys. And many smart people who present out there at the stage. It’s something you need to experience.

Devoxx Poland is my top choice for 2016 as well. For many reasons. Very well organized conference, great topics, great speakers, affordable price, to mention a few. Visiting Krakow in June is a nice experience, too.

In this post I will write a short review of the conference last year (2015).

Read about my summary of Devoxx Poland 2015

Functional programming

The Need for… Functional Programming

A Hardware Issue Became a Software Problem

During the last decades we are all witnesses of computer systems constantly improving in speed, efficiency, increasing space for storing data and decreasing the size of the components. The popular Moore’s law was a correct prediction that the number of transistors of the largest microprocessors will double about every two years, since 1970s. But increasing the number of transistors on a chip and increasing processor’s frequency, among other things, also requires exponentially more power.

Processors were originally developed with only one core. Around 2005, in order to continue delivering regular performance improvements for general-purpose processors, manufacturers such as Intel and AMD have turned to multi-core designs, sacrificing lower manufacturing-costs for higher performance in some applications and systems. (source Wikipedia)

Traditionally, computer software has been written for serial computation. To solve a problem, an algorithm is constructed and implemented as a serial stream of instructions, executed one at a time. In order to use the resources of a multi-core processor, some kind of parallel or concurrent execution approach became a need. Suddenly, due to the change applied by hardware manufacturers, software developers must rethink the design of their programs.

Read more…

Watch online recordings of Java Conferences from 2015

Visiting a conference is a very interesting experience. Plus you can meet some interesting people, hear what’s in hype, learn some new stuff and ask questions. On the other side, due to a budget and/or (what’s missing the most) available time, sometimes it’s not easy to participate to a conference. Nevertheless, this does not have to mean that you should not be able to watch online recordings of some of the interesting talks and presentations. If you search the internet and particularly Youtube, you will be surprised how much interesting stuff is available there. And all for free. Of course, what’s not free – is your free time. 🙂 You’ll have to find some and invest it in widening your horizons.

Since recently it somehow became a practice that many conferences (even big ones) publish recordings of the talks. In the Java world as well. So, if you have some time, you can enjoy recordings of major Java conferences and top industry speakers presentations. In this post I’ll share some links to Youtube playlists with recordings of Java conferences from 2015.

Get recordings of Java conference talks from 2015

vjug

Virtual Java User Group (vJUG)

For some time now I have an idea to start up a Java User Group (JUG) in my hometown. It is still on a level of idea but I’ve started to talk about it with some of the colleagues from local development community. Let’s see. Maybe it will happen some time soon. During my research on the internet, to see how other guys are doing it, I’ve encountered to a virtual Java user group (vJUG or virtualJUG, http://virtualjug.com), which has a global, worldwide level. I was keen to join and become a part of such a community. On top of that, I was very positively surprised when I saw what presentations are held and the speakers who presented them. James Gosling (creator of Java), Simon Ritter (since recently the head Java Evangelist at Oracle), Dr. Venkat Subramaniam (award-winning author, founder of Agile Developer, Inc., an instructional professor at the University of Houston), Matt Raible (technology evangelist, founder of AppFuse)… to name a few.  A lot of quality stuff there. It’s like an online Java conference all year long. And for free.

Read more about virtualJUG and how to join