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

Details

    • Enhancement
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 4.6.0.Final
    • None
    • None

    Description

      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");
          // ......
        }
      }
      

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            finesoft-1 bingo chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: