Spring Framework 6.0 goes GA

Spring Framework 6.0.0 is generally available from Maven Central now! It was quite some time since a major release last happened but this release focuses on 2023 for embracing current and upcoming innovations in OpenJDK and the Java ecosystem. At the same time, it is carefully designed it as a straightforward upgrade from Spring Framework 5.3.x

Continue reading “Spring Framework 6.0 goes GA”

Logging Failed and Successful Authentication Attempts with SpringBoot

Introduction

In the latest OWASP top 10 (OWASP Top 10:2021) list with, the well known standard awareness document for developers and web application security that represents a broad consensus about the most critical security risks to web applications, a mentioned is made regarding identification and authentication failures (A07:2021 – Identification and Authentication Failures). Previously known as “Broken authentication” it refers to the dangers a web application has from week authentication implementations. Bellow I am going to demonstrate the implementation of one of the counter measures which is to be able to log authentication attempts whether these are successful or not. Continue reading “Logging Failed and Successful Authentication Attempts with SpringBoot”

Dockerizing Java Applications the right way

alexius diakogiannis dockerizing java applications

I have created a video and I am showing how to place your java application to a docker container BUT in addition I am showing you how to build the application in the container without needing java runtime in the host machine.

Hope you like it

Subscribe to my youtube channel: https://www.youtube.com/channel/UCw_oF0_P645jIECXAlh9Jsw

Use this url to dowload the awesome GitKraken software: https://www.gitkraken.com/invite/pPxN…

Gist: https://gist.github.com/diakogiannis/

Thanks perigialli tavern for giving the space to shoot: https://www.facebook.com/perigiali.estiatorio

Deploying a Quarkus or any java based microservice behind an Nginx reverse proxy with ssl using docker

Deploying a Quarkus or any java based microservice behind an Nginx reverse proxy with ssl using docker diakogiannis jee.gr

Reposted in my medium blog here 

It has been a while but as per a friend requested I am going to show you how to deploy a Quarkus microservice behind an Nginx reverse proxy using docker.

What are we going to do…

I am going to install docker and docker-compose on a centos 8 host and I am going to deploy a docker container that will expose Nginx on ports 80 and 443 and a microservice using Quarkus. The same technique can be used with ANY java microservices framework like microprofile, Springboot etc because in the end what you will do is run a simple jar file (java is magic right?).

Let’s start…

I am going to skip the installation details for docker and docker-compose. In case you haven’t heard of docker-compose have look here https://gabrieltanner.org/blog/docker-compose and you’ll love it. It automates your container deployments and it just rocks! Continue reading “Deploying a Quarkus or any java based microservice behind an Nginx reverse proxy with ssl using docker”

Can/Should I use parallel streams in a transaction context?

Java

Introduction

To make a long story short, you should not use transactions within a parallel stream. This is because each thread in the parallel stream has its own name thus it does participate in the transaction.

The Streams API is designed to work correctly under certain guidelines. In practice, to benefit from parallelism, each operation is not allowed to change the state of shared objects (such operations are called side-effect-free). Provided you follow this guideline, the internal implementation of parallel streams cleverly splits the data, assigns different parts to independent threads, and merges the final result.

Continue reading “Can/Should I use parallel streams in a transaction context?”

The Transient Keyword in Java and Its Use

This article is originally posted by me in Java Code Geeks with title

The Transient Keyword in Java and Its Use

I recently came a cross in a study project of one of my friends that are studding the basics of programming in Java some forgotten sensitive information printed in text files and remembered the transient keyword in Java.

The transient keyword in Java plays an important role in terms of security and can be very useful in “accidents” like the one above as it will prevent the transmission of sensitive information like for example passwords to files, JSON messages etc that will require serialization.

To cut the long story short, if you define any variable as transient, it will not be serialized unless you define it as static or final.

Lets see some examples bellow. Continue reading “The Transient Keyword in Java and Its Use”

Τα Java VM Options που πρέπει να ξέρεις τι κάνουν!

Είναι πάρα πολλές οι φορές που συναντώ στησίματα σε servers με JVM options και στην ερώτηση μου “γιατί είναι επιλεγμένα αυτά τα options?” η απάντηση είναι: “Γιατί το είχε πει ο “Θανάσης” “που ήξερε” ή “Τι να σου πω; έτσι το βρήκα και μου φάνηκε καλό”.

Αποφάσισα, λοιπόν, να γράψω αυτό το άρθρο, για να αναφέρω τις πιο συχνές παραμέτρους που χρησιμοποιώ εγώ για Java 6 μέχρι και 8, σε παραγωγικά και μη περιβάλλοντα.
Continue reading “Τα Java VM Options που πρέπει να ξέρεις τι κάνουν!”