0

I'm migrating a JBoss EAP application to Quarkus. My application has multiple implementations of the same REST service interface for failover/fallback scenarios:

  • ManagerClientImpl - Primary HTTP client (calls external service)
  • ManagerClientBackup - Local fallback implementation

Both classes implement the same interface:

@Path("/rate")
public interface Service {
    @GET
    @Path("/convert")
    @Produces("application/json")
    Amount convert(@QueryParam("param") String param, ...);
}

The ErrorWhen building with Quarkus, I get:[ERROR] GET /rate is declared by:

[ERROR] ManagerClientImpl#convert
[ERROR] ManagerClientBackup#convert

[ERROR] at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor.checkForDuplicateEndpoint(ResteasyReactiveProcessor.java:1504) [ERROR] at io.quarkus.resteasy.reactive.server.deployment.ResteasyReactiveProcessor.setupEndpoints(ResteasyReactiveProcessor.java:731)

In JBoss, this configuration works fine.

Cannot significantly change existing architecture. Both implementations must exist in the JAR (for producer pattern which is needed for our failover(backup) strategy)

Update:

I have tried 2 solution which didnt work for my case

1.@EndpointDisabled - Doesn't prevent REST endpoint discovery, only disables at runtime

  1. @Alternative + @Priority + BuildProperty annotation - This will work but endpoints discovered at build time

Is there a way in Quarkus to Keep both implementations as REST endpoints in the build Have only ONE actually registered/available at runtime based on CDI producer selection or we if we have any configuration in which I can change it in run time so that when we need to backup solution I can switch to that in run time.

2
  • I would need more information about this in order to be able to help Commented 19 hours ago
  • Please let me know what additional information you need. Commented 14 hours ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.