Skip to content

Clean and easy way to integrate web services in Adobe Experience Manager (AEM) with Feign

License

Notifications You must be signed in to change notification settings

mkovacek/aem-feign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AEM Feign

Looking for clean and easy integration of REST APIs in Adobe Experience Manager (AEM)?

Luckily there is Feign HTTP client which simplifies REST API Integrations.

For more details check Simplify REST API Integrations in AEM with Feign HTTP client

How to use Feign client

interface GitHub {

  @RequestLine("GET /repos/{owner}/{repo}/contributors")
  List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);

  @RequestLine("POST /repos/{owner}/{repo}/issues")
  void createIssue(Issue issue, @Param("owner") String owner, @Param("repo") String repo);

}

public class Contributor {

  private String login;
  private int contributions;
  
}

public class Issue {

  private String title;
  private String body;
  private List<String> assignees;
  private int milestone;
  private List<String> labels;
  
}

public class MyApp {

  public static void main(String... args) {
    GitHub github = Feign.builder()
                         .decoder(new GsonDecoder())
                         .target(GitHub.class, "https://api.github.com");

    // Fetch and print a list of the contributors to this library.
    List<Contributor> contributors = github.contributors("OpenFeign", "feign");
    for (Contributor contributor : contributors) {
      System.out.println(contributor.login + " (" + contributor.contributions + ")");
    }
  }
  
}

Project examples

Faker API and Github API integrations in AEM project

Take a look integrations package

About

Clean and easy way to integrate web services in Adobe Experience Manager (AEM) with Feign

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published