-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
5
-
False
-
-
True
-
-
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.
- Update the DebugClientLogger implementation to not use Quarkus Resteasy Reactive. More info in https://quarkus.io/guides/rest#the-jakarta-rest-way.
- Replace "io.quarkus.rest.client.reactive.QuarkusRestClientBuilder" by "org.eclipse.microprofile.rest.client.RestClientBuilder".
- Verify bad requests are still logged in the Quarkus services. Steps to verify this in https://github.com/RedHatInsights/rhsm-subscriptions/pull/3122.
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 turnpikesince turnpike does not exercise the issue about the query param.
Documentation
- quarkus-rest extension guide: https://quarkus.io/guides/rest
- quarkus-reactive extension guide: https://quarkus.io/guides/resteasy
- blocks
-
SWATCH-2844 Update nginx routing send capacity queries directly to swatch-contracts
-
- Closed
-