Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-3469

Spike: Replace the quarkus-rest extension by quarkus-resteasy extension

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None

      We have been using the quarkus-rest extension (Quarkus Resteasy Reactive) as the server framework for our Quarkus services.

      Moreover, the openapi plugin reads the spec file for each service, and generates the JAX-RS API for our services. Then, Quarkus implements this API using the above mentioned quarkus-rest extension.

      Recently, this extension changed how interpreted the string query params, so regardless whether a query param is not set, or is set to empty, it will return null (see more in https://github.com/quarkusio/quarkus/pull/42468#issuecomment-2302312141).

      And the problem is that we really need to know if the value was not set or was set to empty (this is because we use enum values with EMPTY, see for example: BillingProviderType).

      Note that many users have complained about such a change in https://github.com/quarkusio/quarkus/issues/44885, where unlike Spring, Micronaut or Resteasy (to name some), Quarkus will treat unset and empty query params in the same way. But the maintainers are reluntact to revert this change, therefore we need to stop using this extension.

      As a replacement for the quarkus-rest extension, we can start using the resteasy framework (also for jackson extensions) which we're already familiar with because it's what we're using in our Spring services.

      Acceptance Criteria

      • Replace the following extensions:
      From To
      io.quarkus:quarkus-rest-jackson io.quarkus:quarkus-resteasy-jackson
      io.quarkus:quarkus-rest-client-jackson io.quarkus:quarkus-resteasy-client-jackson
      • At the moment, we have two implementations of TraceResponseFilter: one for the Quarkus Resteasy Reactive extension in swatch-common-trace-response, and another one for Resteasy in swatch-core. We need to remove the first one, and reuse the second one for both spring boot and quarkus services.
      • Replace "io.quarkus.rest.client.reactive.QuarkusRestClientBuilder" by "org.eclipse.microprofile.rest.client.RestClientBuilder".

      If not, find the correct configuration.

      • Add a JUnit test that calls one of our API endpoints and ensure it works when sending: (1) a query param with empty value; (2) a query param with a concrete value; (3) without query param at all. We can reuse an API endpoint that uses one of the above enum values.
      • Ensure CI passes after all above changes.
      • Share your findings with the team to assess risks of this migration.
      • Ensure there is IQE component test coverage for a currently problematic swatch-contracts API that will be effected by this change.
      • Investigate/write a stage IQE test that tests as little as possible (and still be valuable) but exercises this API using turnpike since turnpike does not exercise the issue about the query param.

      Documentation

              jcarvaja@redhat.com Jose Carvajal Hilario
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: