Skip to content

Instantly share code, notes, and snippets.

@pavolloffay
Last active April 18, 2019 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavolloffay/ae8dac07b391ecfa07f797469d7d52d8 to your computer and use it in GitHub Desktop.
Save pavolloffay/ae8dac07b391ecfa07f797469d7d52d8 to your computer and use it in GitHub Desktop.
quarkus-microprofile-blog-post
@Traced
@ApplicationScoped
public class ConversationService {
@Inject
@RestClient
private GreetingService greetingService;
public String talk() {
return greetingService.hello() + " -> " + greetingService.bonjour();
}
}
@Path("/")
public class GreetingResource {
@Inject
public ConversationService conversationService;
@GET
@Path("/hello")
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "hello";
}
@GET
@Path("/bonjour")
@Produces(MediaType.TEXT_PLAIN)
public String bonjour() {
return "bonjour";
}
@GET
@Path("/conversation")
@Produces(MediaType.TEXT_PLAIN)
public String conversation() {
return conversationService.talk();
}
}
@Path("/")
@RegisterRestClient
public interface GreetingService {
@GET
@Path("/hello")
@Produces(MediaType.TEXT_PLAIN)
String hello();
@GET
@Path("/bonjour")
@Produces(MediaType.TEXT_PLAIN)
String bonjour();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment