Tutorial by Examples

To get started we need a factory that produces WebClients. public class ClientFactory { private Map<String, WebClient> cache = new HashMap<>(); public enum RESTClient { PORTAL; } public WebClient fetchRestClient(RESTClient restClient) { if (th...
The jars for CXF JAX-RS are found in Maven: <!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-rs-client --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-rs-client</artifactId> <version>3.1.10</version> ...
One good reason to use Filters is for logging. Using this technique a REST call can be logged and timed easily. public class RestLogger implements ClientRequestFilter, ClientResponseFilter { private static final Logger log = LoggerFactory.getLogger(RestLogger.class); // Used for timing...

Page 1 of 1