Last active
April 18, 2019 16:01
-
-
Save pavolloffay/ae8dac07b391ecfa07f797469d7d52d8 to your computer and use it in GitHub Desktop.
quarkus-microprofile-blog-post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Traced | |
@ApplicationScoped | |
public class ConversationService { | |
@Inject | |
@RestClient | |
private GreetingService greetingService; | |
public String talk() { | |
return greetingService.hello() + " -> " + greetingService.bonjour(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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