Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.