Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1623

Allow JAX-RS Client and WebTarget to be injected

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: new-fraction
    • Labels:
      None

      Description

      Improve developer experience by allowing WildFly Swarm applications to inject an instance of a JAX-RS client, with default or custom configuration, as well as to inject a WebTarget instance with the host address annotated. Examples:

      1- Using CDI extension or similar approach, allow developers to configure and inject a JAX-RS client. This can then allow other fractions like Jaeger to piggy back on the framework and configure the JAX-RS as appropriate.

      @JAXRSClient(config=MyConfig.class) //optional config and/or other
      private javax.ws.rs.client.Client Client;
      

      2- Direction injection of WebTarget to make a call:

      @WebTarget(target="http://myservice.example.com/path")
      private javax.ws.rs.client.WebTarget webTarget;
      

      3- Developer can optionally configure WebTarget with the same annotation:

      @WebTarget(target="http://myservice.example.com/path", client={@JAXRSClient(config=MyConfig.class)})
      private javax.ws.rs.client.WebTarget webTarget;
      

      4- Instead of a web address, can use property key to look up the destination from externally configured source, e..g, project-defaults.yml:

      @WebTarget(targetKey="myservice")
      private javax.ws.rs.client.WebTarget webTarget;
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  bmozaffa Babak Mozaffari
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: