Skip to content
This repository has been archived by the owner on Jan 16, 2020. It is now read-only.
/ api-client Public archive

Declarative API Client for Spring Boot

Notifications You must be signed in to change notification settings

bliblidotcom/api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blibli API Client

Declarative API Client using Spring Web Client and Reactor Netty

Dependency

<dependencies>
    <dependency>
        <groupId>com.blibli.oss</groupId>
        <artifactId>api-client</artifactId>
        <version>${api-client.version}</version>
    </dependency>
</dependencies>

<repository>
  <snapshots>
    <enabled>false</enabled>
  </snapshots>
  <id>bintray-bliblidotcom-maven</id>
  <name>bintray</name>
  <url>https://dl.bintray.com/bliblidotcom/maven</url>
</repository>

How to use It

@EnableApiClient
@SpringBootApplication
public class YourApplication {

}
@ApiClient(
  name = "exampleClient"
)
public interface ExampleClient {

  @RequestMapping("/")
  Mono<String> get();

}
# application.properties
api.client.configs.exampleClient.url=http://example.com
api.client.configs.exampleClient.read-timeout=5s
api.client.configs.exampleClient.write-timeout=5s
api.client.configs.exampleClient.connect-timeout=5s

Supported Annotation

  • @RequestMapping
  • @RequestBody
  • @RequestParam
  • @RequestHeader
  • @PathVariable
  • @CookieValue
  • @RequestPart