-
Notifications
You must be signed in to change notification settings - Fork 36
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
Showing
6 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/BookClient.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,68 @@ | ||
package io.quarkus.ts.http.restclient.reactive; | ||
|
||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.QueryParam; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import io.quarkus.ts.http.restclient.reactive.json.Book; | ||
import io.smallrye.mutiny.Uni; | ||
|
||
@RegisterRestClient | ||
@Path("/books") | ||
@RegisterClientHeaders | ||
@Consumes(MediaType.TEXT_PLAIN) | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public interface BookClient { | ||
|
||
@GET | ||
@Path("/") | ||
@Produces(MediaType.APPLICATION_JSON) | ||
Uni<Book> getBook(@QueryParam("title") String title, @QueryParam("author") String author); | ||
|
||
@Path("/author") | ||
AuthorClient getAuthor(); | ||
|
||
@Consumes(MediaType.TEXT_PLAIN) | ||
@Produces(MediaType.TEXT_PLAIN) | ||
interface AuthorClient { | ||
@GET | ||
@Path("/name") | ||
Uni<String> getName(@QueryParam("author") String author); | ||
|
||
@Path("profession") | ||
ProfessionClient getProfession(); | ||
} | ||
|
||
@Consumes(MediaType.TEXT_PLAIN) | ||
@Produces(MediaType.TEXT_PLAIN) | ||
interface ProfessionClient { | ||
@GET | ||
@Path("/name") | ||
Uni<String> getName(); | ||
|
||
@Path("/wage") | ||
WageClient getWage(); | ||
} | ||
|
||
interface WageClient { | ||
@GET | ||
@Path("/amount") | ||
String getAmount(); | ||
|
||
@Path("/currency") | ||
CurrencyClient getCurrency(); | ||
} | ||
|
||
interface CurrencyClient { | ||
@GET | ||
@Path("/name") | ||
String getName(); | ||
} | ||
|
||
} |
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
1 change: 1 addition & 0 deletions
1
http/rest-client-reactive/src/main/resources/classic.properties
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
io.quarkus.ts.http.restclient.reactive.json.JsonRestInterface/mp-rest/url=http://localhost:${quarkus.http.port} | ||
io.quarkus.ts.http.restclient.reactive.BookClient/mp-rest/url=http://localhost:${quarkus.http.port} |
4 changes: 4 additions & 0 deletions
4
http/rest-client-reactive/src/main/resources/modern.properties
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# new schema introduced in https://github.com/quarkusio/quarkus/pull/17220 . See classic.properties for old-style settings | ||
quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.json.JsonRestInterface".url=http://localhost:${quarkus.http.port} | ||
quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.files.FileClient".url=http://localhost:${quarkus.http.port} | ||
quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.BookClient".url=http://localhost:${quarkus.http.port} | ||
quarkus.rest-client."io.quarkus.ts.http.restclient.reactive.BookClient.AuthorClient".url=http://localhost:${quarkus.http.port} | ||
quarkus.rest-client.logging.scope=request-response | ||
quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG | ||
quarkus.http.limits.max-body-size=3G | ||
quarkus.rest-client.read-timeout = 60000 |
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