Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

Migrated the RM server to Quarkus.

  • pom.xml: Replaced Lyo/Jersey/Jetty dependencies with Quarkus extensions. Added junit-vintage-engine to support legacy JUnit 4 tests.
  • CredentialsFilter.java: Disabled OAuth 1.0a logic to resolve UT010023 incompatibility with Undertow. Basic Auth is verified working.
  • Application.java: Removed HK2 bindings, updated resource registration.
  • RestDelegate.java: Annotated with @ApplicationScoped.
  • Created QuarkusLifecycle to handle Jena/OSLC init.
  • Replaced index.jsp with HomeResource + Qute template.
  • Verified compilation and Basic Auth functionality manually. Existing integration tests compile but require server setup adjustments.

PR created automatically by Jules for task 3560020492887897504 started by @berezovskyi

- Replaced Jersey/Jetty/Cargo with Quarkus (Undertow, Resteasy, Arc).
- Added JUnit 4 Vintage support for existing tests.
- Replaced JSP with Qute templates.
- Migrated Application/Servlet configurations to Quarkus.
- Adjusted CredentialsFilter to bypass problematic OAuth 1.0a logic and support Basic Auth.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
@berezovskyi
Copy link
Member

berezovskyi commented Dec 20, 2025

@Jad-el-khoury this is a big one. I wanted for a long while to use cloud services that run containers directly - no server setup with Linux, reverse proxies etc (examples: Google Cloud Run, Azure Container Apps).

The big problem was that an OSLC server takes 5-10 seconds to start. These cloud services have cheap container hosting options because they shut down your container when nobody is using it. When a request comes, a container is started on the fly.

This PR is a first stab at solving this problem. It shows how a migration from Jersey to Quarkus can be done. On my local machine, the docker container now boots in under 1s:

2025-12-20T18:02:33.581013608Z Handler java.util.logging.ConsoleHandler is not defined
2025-12-20T18:02:33.659577316Z SLF4J(W): Class path contains multiple SLF4J providers.
2025-12-20T18:02:33.659661858Z SLF4J(W): Found provider [org.slf4j.impl.JBossSlf4jServiceProvider@72035809]
2025-12-20T18:02:33.659711399Z SLF4J(W): Found provider [org.slf4j.simple.SimpleServiceProvider@909217e]
2025-12-20T18:02:33.659736774Z SLF4J(W): See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2025-12-20T18:02:33.659885608Z SLF4J(I): Actual provider is of type [org.slf4j.impl.JBossSlf4jServiceProvider@72035809]
2025-12-20T18:02:34.133389399Z __  ____  __  _____   ___  __ ____  ______ 
2025-12-20T18:02:34.133407649Z  --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
2025-12-20T18:02:34.133409358Z  -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
2025-12-20T18:02:34.133410691Z --\___\_\____/_/ |_/_/|_/_/|_|\____/___/  
...
2025-12-20T18:02:34.172004358Z 2025-12-20 18:02:34,162 INFO  [co.osl.ref.rm.gen.ser.QuarkusLifecycle] (main) Initializing QuarkusLifecycle...
2025-12-20T18:02:34.172016024Z 2025-12-20 18:02:34,162 INFO  [co.osl.ref.rm.gen.ser.QuarkusLifecycle] (main) Setting public URI: http://localhost:8800/
2025-12-20T18:02:34.172017524Z 2025-12-20 18:02:34,163 INFO  [co.osl.ref.rm.gen.ser.QuarkusLifecycle] (main) Setting servlet path: services
2025-12-20T18:02:34.238762900Z 2025-12-20 18:02:34,235 INFO  [io.quarkus] (main) server-rm 0.3.0-SNAPSHOT on JVM (powered by Quarkus 3.17.4) started in 0.787s. Listening on: http://0.0.0.0:8800
2025-12-20T18:02:34.238775025Z 2025-12-20 18:02:34,236 INFO  [io.quarkus] (main) Profile prod activated. 
2025-12-20T18:02:34.238776691Z 2025-12-20 18:02:34,236 INFO  [io.quarkus] (main) Installed features: [cdi, qute, resteasy, resteasy-jackson, resteasy-qute, servlet, smallrye-context-propagation, smallrye-openapi, vertx]

started in 0.787s. 😂

The downside is that JSP pages are not supported. Instead, Quarkus uses its own templating engine, Qute (better for security too, as the template engine does not eval raw Java code in templates).

This PR shows a migration of the RM server to Quarkus with the following highlights:

  • /services prefix is dropped - Dobby is free at last!
  • One selection dialog was migrated to Qute as an example. To see it in action, start the RM server, go to https://oslc.github.io/oslc-selection-utils/ and paste http://localhost:8800/serviceProviders/sp_single/service1/requirements/selector as a Selection Dialog URI.
  • The home page is migrated to use Qute templates
image

The RDF seems to work as well:

curl -fsSL http://localhost:8800/catalog/singleton -H "Accept: application/rdf+xml" | head -5
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#"

There is one more performance optimization that I have not tried yet, which is to replace the JDK with GraalVM. Should make things even faster and take less RAM, at least initially.

P.S. Next step is https://camel.apache.org/camel-quarkus/ ;)

@google-labs-jules

This comment was marked as off-topic.

google-labs-jules bot and others added 4 commits December 20, 2025 18:34
- Replaced Jersey/Jetty/Cargo with Quarkus (Undertow, Resteasy, Arc).
- Added JUnit 4 Vintage support for existing tests.
- Replaced JSP with Qute templates.
- Migrated Application/Servlet configurations to Quarkus.
- Adjusted CredentialsFilter to bypass problematic OAuth 1.0a logic and support Basic Auth.
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
This reverts commit ecf976b.

Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
Signed-off-by: Andrew Berezovskyi <andriib@kth.se>
@berezovskyi
Copy link
Member

@Jad-el-khoury some notes extracted from this migration:

OSLC/developing-oslc-applications#43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants