Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2838

In the implementation of microprofile-rest-client, can it support the use of plain interfaces in CDI beans to inject remote service proxy?

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 4.6.0.Final
    • None
    • Undefined

      In the implementation of microprofile-rest-client, can it support the use of plain interfaces in CDI beans to inject remote service proxy?

      The application scenarios are as follows:

      // The plain interface
      public interface MyService {
        MyDTO get(String id);
      }
      
      // The rest client
      @Path("/my_service")
      @RegisterRestClient(configKey = "my_service")
      @RegisterClientHeaders
      @Consumes(APPLICATION_JSON)
      @Produces(APPLICATION_JSON)
      public interface MyServiceRestClient extends MyService {
        @Override
        @Path("/get/{id}")
        @GET
        MyDTO get(String id);
      }
      
      // The usage
      @ApplicationScope
      public class MyAnotherService {
        @Inject
        @RestClient
        MyService myService;
      
        public void doSmothing() {
          MyDTO md = myService.get("the id");
          // ......
        }
      }
      

       

              rh-ee-cdasoula Christina Dasoula
              finesoft-1 bingo chen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: