MCPcopy Index your code
hub / github.com/OpenFeign/feign-vertx

github.com/OpenFeign/feign-vertx @6.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 6.0.1 ↗ · + Follow
187 symbols 630 edges 29 files 51 documented · 27% 1 cross-repo links updated 5mo ago★ 61
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

feign-vertx

CI Coverage Status Maven Central javadoc

Implementation of Feign on Vertx. Brings you the best of two worlds together : concise syntax of Feign to write client side API on fast, asynchronous and non-blocking HTTP client of Vertx.

Installation

With Maven

<dependencies>
    ...
    <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-vertx</artifactId>
        <version>6.0.1</version>
    </dependency>
    ...
</dependencies>

With Gradle

compile group: 'io.github.openfeign', name: 'feign-vertx', version: '6.0.1'

Compatibility

Feign feign-vertx Vertx
8.x 1.x+ 3.5.x - 3.9.x (except 3.5.2)
9.x 2.x+ 3.5.x - 3.9.x (except 3.5.2)
10.x (except 10.5.0) 3.x+ 3.5.x - 3.9.x (except 3.5.2)
11.x 4.x+ 3.5.x - 3.9.x (except 3.5.2)
11.x 5.x+ 4.x
12.x unsupported
13.x 6.x+ 4.x

Usage

Write Feign API as usual, but every method of interface must return io.vertx.core.Future.

@Headers({ "Accept: application/json" })
interface IcecreamServiceApi {

  @RequestLine("GET /icecream/flavors")
  Future<Collection<Flavor>> getAvailableFlavors();

  @RequestLine("GET /icecream/mixins")
  Future<Collection<Mixin>> getAvailableMixins();

  @RequestLine("POST /icecream/orders")
  @Headers("Content-Type: application/json")
  Future<Bill> makeOrder(IceCreamOrder order);

  @RequestLine("GET /icecream/orders/{orderId}")
  Future<IceCreamOrder> findOrder(@Param("orderId") int orderId);

  @RequestLine("POST /icecream/bills/pay")
  @Headers("Content-Type: application/json")
  Future<Void> payBill(Bill bill);
}

Build the client :

Vertx vertx = Vertx.vertx();  // get Vertx instance

/* Create instance of your API */
IcecreamServiceApi icecreamApi = VertxFeign
    .builder()
    .vertx(vertx) // provide vertx instance
    .encoder(new JacksonEncoder())
    .decoder(new JacksonDecoder())
    .target(IcecreamServiceApi.class, "http://www.icecreame.com");

/* Execute requests asynchronously */
Future<Collection<Flavor>> flavorsFuture = icecreamApi.getAvailableFlavors();
Future<Collection<Mixin>> mixinsFuture = icecreamApi.getAvailableMixins();

License

Library distributed under Apache License Version 2.0.

Extension points exported contracts — how you extend this code

HelloServiceAPI (Interface)
Example of an API to to test number of Http2 connections of Feign. @author James Xu
src/test/java/feign/vertx/testcase/HelloServiceAPI.java
RawServiceAPI (Interface)
Example of an API to to test rarely used features of Feign. @author Alexei KLENIN
src/test/java/feign/vertx/testcase/RawServiceAPI.java
IcecreamServiceApiBroken (Interface)
API of an iceream web service with one method that doesn't returns Future and violates {@link VertxDelegatingCon
src/test/java/feign/vertx/testcase/IcecreamServiceApiBroken.java
IcecreamServiceApi (Interface)
API of an iceream web service. @author Alexei KLENIN
src/test/java/feign/vertx/testcase/IcecreamServiceApi.java

Core symbols most depended-on inside this repo

builder
called by 17
src/main/java/feign/VertxFeign.java
target
called by 15
src/main/java/feign/VertxFeign.java
vertx
called by 14
src/main/java/feign/VertxFeign.java
decoder
called by 13
src/main/java/feign/VertxFeign.java
options
called by 12
src/main/java/feign/VertxFeign.java
getAvailableFlavors
called by 8
src/test/java/feign/vertx/testcase/RawServiceAPI.java
logLevel
called by 7
src/main/java/feign/VertxFeign.java
logger
called by 7
src/main/java/feign/VertxFeign.java

Shape

Method 145
Class 35
Interface 5
Enum 2

Languages

Java100%

Modules by API surface

src/main/java/feign/VertxFeign.java28 symbols
src/main/java/feign/VertxMethodHandler.java15 symbols
src/main/java/feign/VertxBuildTemplateByResolvingArgs.java15 symbols
src/test/java/feign/vertx/VertxHttpClientTest.java14 symbols
src/test/java/feign/vertx/AbstractClientReconnectTest.java13 symbols
src/test/java/feign/vertx/testcase/domain/IceCreamOrder.java12 symbols
src/main/java/feign/VertxInvocationHandler.java10 symbols
src/test/java/feign/vertx/testcase/domain/Bill.java7 symbols
src/test/java/feign/vertx/QueryMapEncoderTest.java7 symbols
src/test/java/feign/vertx/testcase/domain/OrderGenerator.java6 symbols
src/test/java/feign/vertx/testcase/IcecreamServiceApi.java6 symbols
src/test/java/feign/vertx/ConnectionsLeakTests.java6 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add feign-vertx \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact