-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fdf296
commit 95c6a3d
Showing
3 changed files
with
103 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
41 changes: 41 additions & 0 deletions
41
...ions/micrometer/deployment/src/test/java/io/quarkus/micrometer/test/GreetingResource.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.quarkus.micrometer.test; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
import org.eclipse.microprofile.rest.client.inject.RestClient; | ||
|
||
@Path("/") | ||
@ApplicationScoped | ||
public class GreetingResource { | ||
|
||
@RegisterRestClient(configKey = "greeting") | ||
public interface GreetingRestClient { | ||
@GET | ||
@Path("/echo/{message}") | ||
@Consumes(MediaType.TEXT_PLAIN) | ||
String echo(@PathParam("message") String name); | ||
} | ||
|
||
@RestClient | ||
GreetingRestClient greetingRestClient; | ||
|
||
@GET | ||
@Path("greeting/{message}") | ||
public String passThrough(@PathParam("message") String message) { | ||
return greetingRestClient.echo(message + " World!"); | ||
} | ||
|
||
@GET | ||
@Path("/echo/{message}") | ||
public Response echo(@PathParam("message") String message) { | ||
return Response.ok(message, "text/plain").build(); | ||
} | ||
|
||
} |