The English version of quarkus.io is the official project site. Translated sites are community supported on a best-effort basis.

Revolutionising Telecom Microservice - Modernising JDiameter with Quarkus

]

はじめに

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:

  1. Simplified Configuration: Moving the configuration to the "application.properties“ file to make the stack easier to configure.

  2. Dependency Injection: Enabling dependency injection of Diameter stacks and configuration into a scoped service.

  3. 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 Quarkiverse Hub. Documentation for the stack is available at Quarkus JDiameter Documentation.

まとめ

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!