Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog on Quarkus JDiameter Extension #2082

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion _data/authors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sannegrinovero:
leydenquarkus:
name: "Maria Arias de Reyna Dominguez, Andrew Dinn, Sanne Grinovero"
job_title: "OpenJDK and Quarkus team working on Project Leyden at Red Hat"
bio: "Maria Arias de Reyna Dominguez is a Java Champion and member of the OpenJDK team at Red Hat; Andrew Dinn is a Distinguished Engineer at Red Hat, and Architect responsible for OpenJDK and GraalVM; Sanne Grinovero is a Java Champion, founding member of the Quarkus project and Architect in the middleware group at Red Hat."
bio: "Maria Arias de Reyna Dominguez is a Java Champion and member of the OpenJDK team at Red Hat; Andrew Dinn is a Distinguished Engineer at Red Hat, and Architect responsible for OpenJDK and GraalVM; Sanne Grinovero is a Java Champion, founding member of the Quarkus project and Architect in the middleware group at Red Hat."
dandreadis:
name: "Dimitris Andreadis"
email: "[email protected]"
Expand Down Expand Up @@ -559,3 +559,10 @@ karesti:
job_title: "Engineer (Software)"
twitter: "karesti"
bio: "Software Engineer at Red Hat and Infinispan team member."
eddiecarpenter:
name: "Eddie Carpenter"
email: "[email protected]"
emailhash: "1eafb77e5daee9aba696f7c23de0bc86"
job_title: "Principal Software Engineer"
twitter: ""
bio: "Principal Software Engineer and IT Executive"
44 changes: 44 additions & 0 deletions _posts/2024-08-19-quarkus-jdiameter-intro.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
layout: post
title: 'Revolutionising Telecom Microservice - Modernising JDiameter with Quarkus'
date: 2024-08-19
tags: user-story jdiameter
synopsis: My journey of with JDiameter and Quarkus
author: eddiecarpenter
---
:imagesdir: /assets/images/posts/quarkus-jdiameter-intro

image::quarkus-jdiameter-intro.png[],align="center"]
= Introduction

The Diameter protocol serves as a cornerstone in any modern telecommunication backend, providing authentication, authorisation, and accounting (AAA) services in 3G, IMS, 4G, and 5G networks. Several vendors offer commercially licensed Diameter stacks, most of which are written in C++. As a result, many in the Java world have turned to the open-source RestComm JDiameter stack.

Developed in the early 2010s, JDiameter has not received any updates in the last seven years. A major challenge with JDiameter is its reliance on outdated dependencies—some with known Common Vulnerabilities and Exposures (CVEs)—and others that are deprecated or no longer supported. Additionally, JDiameter was written in Java 1.7, which restricts the use of modern advancements in the Java language, such as virtual threading.

With the shift towards microservices in telecommunications, many organisations now develop solutions that are deployed and managed using platforms like Kubernetes and OpenShift. In the Java ecosystem, developers have several microservices frameworks to choose from, with the major ones being Spring Boot, Micronaut, and my preferred choice, Quarkus.

Over the past seven years, I have primarily developed solutions for charging and billing subscribers in prepaid mobile networks, including writing both a Diameter Routing Agent (DRA) and an Online Charging System (OCS). In both instances, I used Quarkus as the microservices framework and JDiameter as the Diameter stack—with much frustration, I must add.

The solutions we developed were functional, but they felt more like a Quarkus application with a JDiameter sidecar. The Diameter stack operated independently, without leveraging the benefits offered by the Quarkus framework.

= Quarkus JDiameter Extension

Eventually, my frustration with the sidecar approach of integrating JDiameter with Quarkus led me to develop a solution that would allow the two to work more harmoniously. This initiative resulted in the creation of the Quarkus JDiameter extension.

As mentioned earlier, the RestComm JDiameter stack had been neglected and was in dire need of some attention. My first step was to modernise the JDiameter stack by removing deprecated dependencies and updating the outdated ones to their latest versions.

Two key changes were made to the stack. The first was removing Pico containers—an outdated dependency injection framework from the pre-Java EE era—and the second was replacing the concurrency logic from the old Thread Group model with the more modern Thread Pool model. With the introduction of thread pooling, the Diameter stack can now utilise virtual threading!

The next challenge was to develop a Quarkus extension to integrate the Diameter stack into the Quarkus framework. I had three main objectives with this extension:

. *Simplified Configuration*: Moving the configuration to the "application.properties“ file to make the stack easier to configure.
. *Dependency Injection*: Enabling dependency injection of Diameter stacks and configuration into a scoped service.
. *Interceptor Service Framework*: Creating an interceptor service framework for a more straightforward implementation of Diameter applications.

The Quarkus JDiameter stack has been released and is now part of Quarkiverse Hub. You can find it at link:https://github.com/quarkiverse/quarkus-jdiameter[Quarkiverse Hub]. Documentation for the stack is available at link:https://docs.quarkiverse.io/quarkus-jdiameter/2.0.0/index.html[Quarkus JDiameter Documentation].
gastaldi marked this conversation as resolved.
Show resolved Hide resolved

= Conclusion

There is still considerable potential for tighter integration of the JDiameter stack into the Quarkus framework. A future project could involve exposing the statistics collected in the stack via the Quarkus MicroProfile Metrics interface.

If you’ve been frustrated with integrating JDiameter in a microservice environment, as I was, give the Quarkus JDiameter extension a try!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.