Skip to main content

Posts

Showing posts with the label REST client

JAX-rs client with connection and response timeout using jersey

In this tutorial we will learn how to use JAX-rs API with jersey client API to communicate with Restful service. Maven dependencies I have created this example using the Spring boot application, so I need only starter dependencies which are listed as below. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jersey</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> If you are not using spring application then you need to add below dependencies in your pom. <dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</dependency> </dependency> <dependency> <groupId>org.glassfish.jersey.inject</groupId> <artifactId>jersey-hk2</dependency> ...