Created
December 6, 2018 15:51
-
-
Save struberg/9ab7d9a6de6b6cb4152d99cc185854f3 to your computer and use it in GitHub Desktop.
Meecrowave JAX-RS Client via Interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ApplicationScoped | |
public class MySvcClient { | |
@javax.enterprise.inject.Produces | |
@RequestScoped | |
@RemoteClient //x that's our circuit breaker, adding log correlation, etc | |
public MySvc getMySvc() { | |
String serviceUrl = config.getValue("my.app.endpoints.mySvc", String.class); //mp-config for getting the endpoint url | |
return org.apache.cxf.jaxrs.client.JAXRSClientFactory.create(serviceUrl, MySvc.class); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment