TAG: Java

Apache camel

Recently I had the opportunity to play with Apache Camel and Spring Boot. I found the result quite entertaining! If you haven’t heard the name before, it is an open source routing tool which can receive messages, process them and send them to other destinations. In my case, I was reading payment messages from one topic, storing them in a db and then scheduled request with a POST call to another server.

[READ MORE]
Creating Java annotations

I am pretty sure most of us have used custom annotation in our projects at some point. Today we will go step by step and see how to create our own! Annotations in Java are everywhere, from @test, @BeforeClass, @AfterClass in Junit, @Override,@Deprecated in Java SE or @Inject, @Decorator in Java EE or @Entity in JPA. The first step is to declare an interface with @ .The use of @ denotes that our interface will be of annotation type.

[READ MORE]
JShell

For those who haven’t heard the news, Java has officially its own shell, named (obviously) JShell since Java 9. It is a REPL type of environment where you type your code in the command line interface and see the results immediately on your screen. This is a good way to test simple programming concepts and ideas without the inherited boilerplate verbosity, which JUnit or main function has. Also semicolons in the end are optional!

[READ MORE]
Java 10 + var = L.F.E.

New variable type named ‘var’ in Java 10? Have we started turning into JavaScript anarchists? Has its very substance been polluted by Kotlin enthusiasts? Should we all worry by this new “feature” (are we sure its not a bug?) or could there be any benefits from using ‘var’ in our code? Var is used for type inference in Java and helps reduce the verbosity of the language. This means you are able to omit variables’ type, as it will be inferred by the compiler by looking at the right hand part of the assignment.

[READ MORE]
JCrete 2018

Last July I had the opportunity to make three of my life dreams come true. First was taking a hike to Verliga dragonlake in Pindos, Greece. The second was watching Justice live which happened during We Are Electric festival in Holland. The third and most relative to this blog was attending JCrete unconference. During my 4 year professional experience as a java developer, I have been to many conferences and meetings across Greece.

[READ MORE]