Skip to content

Commit

Permalink
Merge pull request #14009 from aureamunoz/13793-fix-guide
Browse files Browse the repository at this point in the history
Refactor getting-started-reactive guide according to new resteasy-reactive extension codestart
  • Loading branch information
geoand authored Dec 22, 2020
2 parents 0583a7d + 598d089 commit 8c5859f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/src/main/asciidoc/getting-started-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \
-DprojectArtifactId=getting-started-reactive \
-DclassName="org.acme.quickstart.ReactiveGreetingResource" \
-Dpath="/hello" \
-Dextensions="resteasy-mutiny, resteasy-jackson"
-Dextensions="resteasy-reactive"
cd getting-started-reactive
----

Expand All @@ -181,14 +181,14 @@ For Windows users

[source,bash,subs=attributes+]
----
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started-reactive -DclassName="org.acme.quickstart.ReactiveGreetingResource" -Dpath="/hello" -Dextensions="resteasy-mutiny,resteasy-jackson"
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create -DprojectGroupId=org.acme -DprojectArtifactId=getting-started-reactive -DclassName="org.acme.quickstart.ReactiveGreetingResource" -Dpath="/hello" -Dextensions="resteasy-reactive"
----

- If using Powershell, wrap `-D` parameters in double quotes

[source,bash,subs=attributes+]
----
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create "-DprojectGroupId=org.acme" "-DprojectArtifactId=getting-started-reactive" "-DclassName=org.acme.quickstart.ReactiveGreetingResource" "-Dpath=/hello" "-Dextensions=resteasy-mutiny,resteasy-jackson"
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create "-DprojectGroupId=org.acme" "-DprojectArtifactId=getting-started-reactive" "-DclassName=org.acme.quickstart.ReactiveGreetingResource" "-Dpath=/hello" "-Dextensions=resteasy-reactive"
----

It generates the following in `./getting-started-reactive`:
Expand Down Expand Up @@ -277,7 +277,7 @@ public class ReactiveGreetingResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/greeting/{name}")
public Uni<String> greeting(@PathParam String name) {
public Uni<String> greeting(String name) {
return service.greeting(name);
}
Expand All @@ -297,16 +297,16 @@ NOTE: In order to get Mutiny working properly with JAX-RS resources, make sure t
[source,bash,subs=attributes+]
----
mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:add-extensions \
-Dextensions="io.quarkus:quarkus-resteasy-mutiny"
-Dextensions="io.quarkus:quarkus-resteasy-reactive"
----

Or add `quarkus-resteasy-mutiny` into your dependencies manually.
Or add `quarkus-resteasy-reactive` into your dependencies manually.

[source, xml]
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-mutiny</artifactId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
----

Expand Down Expand Up @@ -342,9 +342,9 @@ In the `ReactiveGreetingResource` add the following method:
[source, java]
----
@GET
@Produces(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
@Path("/greeting/{count}/{name}")
public Multi<String> greetings(@PathParam int count, @PathParam String name) {
public Multi<String> greetings(int count, String name) {
return service.greetings(count, name);
}
----
Expand All @@ -357,7 +357,7 @@ So calling the endpoint produces something like:
[source,shell]
----
$ curl http://localhost:8080/hello/greeting/3/neo
["hello neo - 0","hello neo - 1","hello neo - 2"]
hello neo - 0hello neo - 1hello neo - 2
----

We can also generate Server-Sent Event responses by returning a `Multi`:
Expand All @@ -366,9 +366,9 @@ We can also generate Server-Sent Event responses by returning a `Multi`:
----
@GET
@Produces(MediaType.SERVER_SENT_EVENTS)
@SseElementType(MediaType.TEXT_PLAIN)
@RestSseElementType(MediaType.TEXT_PLAIN)
@Path("/stream/{count}/{name}")
public Multi<String> greetingsAsStream(@PathParam int count, @PathParam String name) {
public Multi<String> greetingsAsStream(int count, String name) {
return service.greetings(count, name);
}
----
Expand Down

0 comments on commit 8c5859f

Please sign in to comment.