Skip to content

Instantly share code, notes, and snippets.

@struberg
Created December 6, 2018 15:51
Show Gist options
  • Save struberg/9ab7d9a6de6b6cb4152d99cc185854f3 to your computer and use it in GitHub Desktop.
Save struberg/9ab7d9a6de6b6cb4152d99cc185854f3 to your computer and use it in GitHub Desktop.
Meecrowave JAX-RS Client via Interface
@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