GithubHelp home page GithubHelp logo

smallrye-rest-client's Introduction

Semaphore CI License

SmallRye Rest Client

SmallRye Rest Client is an implementation of Eclipse MicroProfile Rest Client.

Build

To build simply run

$ mvn clean install

Project Structure

  • docs - project documentation

  • implementation - produces implementation artifact

  • testsuite

    • basic - basic testsuite, tests functionalities which are not covered by the TCK

    • common - test utils shared accross all test suites

    • tck - TCK runner

Non-portable Features

CDI Interceptors Support

In general, Rest Client proxies are not created by the CDI container and therefore method invocations do not pass through CDI interceptors. In SmallRye, however, you can associate business method interceptors (denoted by the @AroundInvoke annotation) with a Rest Client proxy by using interceptor bindings. The primary use case is the support of MicroProfile Fault Tolerance annotations, for example:

import org.eclipse.microprofile.faulttolerance.Retry;

@Path("/v1")
interface MyClient {

    @Retry(maxRetries = 3) // Retry on any exception thrown
    @GET
    @Path("/hello")
    String hello();
}
Note
The org.eclipse.microprofile.faulttolerance.Asynchronous annotation is currently not supported because the underlying RESTEasy client is not able to handle the java.util.concurrent.Future return types.

RestClientProxy

In addition to the MicroProfile Rest Client specification, every Rest Client proxy implements io.smallrye.restclient.RestClientProxy interface which allows you to:

  • obtain the underlying javax.ws.rs.client.Client instance

  • release all associated resources, for example:

public void hello() {
   MyClient myClient = RestClientBuilder.newBuilder().build(MyClient.class);
   myClient.hello();
   // Finally release all associated resources
   ((RestClientProxy) helloClient).close();
}

smallrye-rest-client's People

Contributors

kenfinnigan avatar mkouba avatar dependabot-support avatar michalszynkiewicz avatar smallrye-ci avatar dvddhln avatar sberyozkin avatar asoldano avatar doychin avatar ipastusi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.