Adding --components-path in all examples. (#304)

This commit is contained in:
Artur Souza 2020-07-14 18:41:00 -07:00 committed by GitHub
parent 5eba96437f
commit 25e6e158dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 34 additions and 33 deletions

View File

@ -16,7 +16,7 @@ import java.util.List;
* 1. Build and install jars:
* mvn clean install
* 2. Run the client:
* dapr run --app-id demoactorclient --port 3006 -- java -jar \
* dapr run --components-path ./components --app-id demoactorclient --port 3006 -- java -jar \
* examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.actors.http.DemoActorClient
*/
public class DemoActorClient {

View File

@ -19,7 +19,7 @@ import java.time.Duration;
* 1. Build and install jars:
* mvn clean install
* 2. Run the server:
* dapr run --app-id demoactorservice --app-port 3000 --port 3005 \
* dapr run --components-path ./components --app-id demoactorservice --app-port 3000 --port 3005 \
* -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.actors.http.DemoActorService -p 3000
*/

View File

@ -124,7 +124,7 @@ The `@ActorType` annotation indicates the Dapr Java SDK that this interface is a
Now, execute the following script in order to run DemoActorService:
```sh
cd to [repo-root]
dapr run --app-id demoactorservice --app-port 3000 --port 3005 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.actors.http.DemoActorService -p 3000
dapr run --components-path ./components --app-id demoactorservice --app-port 3000 --port 3005 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.actors.http.DemoActorService -p 3000
```
### Running the Actor client
@ -184,7 +184,7 @@ Use the follow command to execute the DemoActorClient:
```sh
cd to [repo-root]
dapr run --app-id demoactorclient --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.actors.http.DemoActorClient
dapr run --components-path ./components --app-id demoactorclient --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.actors.http.DemoActorClient
```
Once running, the `DemoActorClient` logs will start displaying the different steps:

View File

@ -17,7 +17,7 @@ import org.apache.commons.cli.Options;
* mvn clean install
* 2. cd to [repo-root]/examples
* 3. Run :
* dapr run --app-id inputbinding --app-port 3000 --port 3005 \
* dapr run --components-path ./components --app-id inputbinding --app-port 3000 --port 3005 \
* -- java -jar target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.bindings.http.InputBindingExample -p 3000
*/

View File

@ -14,7 +14,7 @@ import io.dapr.client.DaprClientBuilder;
* mvn clean install
* 2. cd to [repo-root]/examples
* 3. Run the program:
* dapr run --app-id outputbinding --port 3006 \
* dapr run --components-path ./components --app-id outputbinding --port 3006 \
* -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.bindings.http.OutputBindingExample
*/
public class OutputBindingExample {

View File

@ -89,7 +89,7 @@ public class InputBindingController {
Execute the follow script in order to run the Input Binding example:
```sh
cd to [repo-root]/examples
dapr run --app-id inputbinding --app-port 3000 --port 3005 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.bindings.http.InputBindingExample -p 3000
dapr run --components-path ./components --app-id inputbinding --app-port 3000 --port 3005 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.bindings.http.InputBindingExample -p 3000
```
### Running the Output binding sample
@ -126,7 +126,7 @@ Use the follow command to execute the Output Binding example:
```sh
cd to [repo-root]/examples
dapr run --app-id outputbinding --port 3006 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.bindings.http.OutputBindingExample
dapr run --components-path ./components --app-id outputbinding --port 3006 -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.bindings.http.OutputBindingExample
```
Once running, the OutputBindingExample should print the output as follows:

View File

@ -13,7 +13,7 @@ import io.dapr.client.domain.Verb;
* 1. Build and install jars:
* mvn clean install
* 2. Send messages to the server:
* dapr run -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* dapr run --components-path ./components -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.invoke.grpc.HelloWorldClient
*/
public class HelloWorldClient {

View File

@ -30,7 +30,7 @@ import static io.dapr.examples.DaprExamplesProtos.SayResponse;
* 1. Build and install jars:
* mvn clean install
* 2. Run in server mode:
* dapr run --app-id hellogrpc --app-port 5000 --protocol grpc \
* dapr run --components-path ./components --app-id hellogrpc --app-port 5000 --protocol grpc \
* -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.invoke.grpc.HelloWorldService \
* -p 5000

View File

@ -69,7 +69,7 @@ In the `GrpcHelloWorldDaprService` class, the `onInvoke` method is the most impo
Now run the service code:
```sh
dapr run --app-id hellogrpc --app-port 5000 --protocol grpc -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.grpc.HelloWorldService -p 5000
dapr run --components-path ./components --app-id hellogrpc --app-port 5000 --protocol grpc -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.grpc.HelloWorldService -p 5000
```
The `app-id` argument is used to identify this service in Dapr's runtime. The `app-port` determines which port Dapr's runtime should call into this service. The `protocol` argument informs Dapr which protocol it should use to invoke the application: `grpc` or `http`(default).
@ -108,7 +108,7 @@ Finally, it will go through in an infinite loop and invoke the `say` method ever
Finally, open a new command line terminal and run the client code to send some messages.
```sh
dapr run -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.grpc.HelloWorldClient
dapr run --components-path ./components -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.grpc.HelloWorldClient
```
Once the messages are sent, use `CTRL+C` to exit Dapr.

View File

@ -15,7 +15,7 @@ import org.apache.commons.cli.Options;
* 1. Build and install jars:
* mvn clean install
* 2. Run in server mode:
* dapr run --app-id invokedemo --app-port 3000 --port 3005 \
* dapr run --components-path ./components --app-id invokedemo --app-port 3000 --port 3005 \
* -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.invoke.http.DemoService -p 3000
*/

View File

@ -13,7 +13,7 @@ import io.dapr.client.domain.Verb;
* 1. Build and install jars:
* mvn clean install
* 2. Send messages to the server:
* dapr run --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* dapr run --components-path ./components --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.invoke.http.InvokeClient 'message one' 'message two'
*/
public class InvokeClient {

View File

@ -89,7 +89,7 @@ public class DemoServiceController {
Use the follow command to execute the demo service example:
```sh
dapr run --app-id invokedemo --app-port 3000 --port 3005 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.http.DemoService -p 3000
dapr run --components-path ./components --app-id invokedemo --app-port 3000 --port 3005 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.http.DemoService -p 3000
```
Once running, the ExposerService is now ready to be invoked by Dapr.
@ -120,7 +120,7 @@ The class knows the app id for the remote application. It uses the the static `D
Execute the follow script in order to run the InvokeClient example, passing two messages for the remote method:
```sh
dapr run --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.http.InvokeClient 'message one' 'message two'
dapr run --components-path ./components --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.invoke.http.InvokeClient 'message one' 'message two'
```
Once running, the output should display the messages sent from invoker in the demo service output as follows:

View File

@ -15,7 +15,7 @@ import java.util.Collections;
* 1. Build and install jars:
* mvn clean install
* 2. Run the program:
* dapr run --app-id publisher --port 3006 -- \
* dapr run --components-path ./components --app-id publisher --port 3006 -- \
* java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.pubsub.http.Publisher
*/
public class Publisher {

View File

@ -70,7 +70,7 @@ public class SubscriberController {
```
Execute the follow script in order to run the Subscriber example:
```sh
dapr run --app-id subscriber --app-port 3000 --port 3005 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.pubsub.http.Subscriber -p 3000
dapr run --components-path ./components --app-id subscriber --app-port 3000 --port 3005 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.pubsub.http.Subscriber -p 3000
```
### Running the publisher
@ -118,7 +118,7 @@ public class Publisher {
Use the follow command to execute the Publisher example:
```sh
dapr run --app-id publisher --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.pubsub.http.Publisher
dapr run --components-path ./components --app-id publisher --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.pubsub.http.Publisher
```
Once running, the Publisher should print the output as follows:

View File

@ -16,7 +16,7 @@ import org.apache.commons.cli.Options;
* 1. Build and install jars:
* mvn clean install
* 2. Run the server:
* dapr run --app-id subscriber --app-port 3000 --port 3005 -- \
* dapr run --components-path ./components --app-id subscriber --app-port 3000 --port 3005 -- \
* java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.pubsub.http.Subscriber -p 3000
*/
public class Subscriber {

View File

@ -100,7 +100,7 @@ The secret store's name **must** match the component's name defined in `< repo d
Execute the follow script in order to run the example:
```sh
cd to [repo-root]/examples
dapr run -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.secrets.SecretClient movie
dapr run --components-path ./components -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.secrets.SecretClient movie
```
Once running, the program should print the output as follows:

View File

@ -18,7 +18,8 @@ import java.util.Map;
* 3. Add secret to vault:
* vault kv put secret/dapr/movie title="[my favorite movie]"
* 4. Read secret from example:
* dapr run -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.secrets.SecretClient movie
* dapr run --components-path ./components -- \
* java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.secrets.SecretClient movie
*/
public class SecretClient {

View File

@ -62,7 +62,7 @@ The code uses the `DaprClient` created by the `DaprClientBuilder`. Notice that t
Run this example with the following command:
```sh
dapr run --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.state.StateClient 'my message'
dapr run --components-path ./components --port 3006 -- java -jar examples/target/dapr-java-sdk-examples-exec.jar io.dapr.examples.state.StateClient 'my message'
```
Once running, the OutputBindingExample should print the output as follows:

View File

@ -14,7 +14,7 @@ import reactor.core.publisher.Mono;
* 1. Build and install jars:
* mvn clean install
* 2. send a message to be saved as state:
* dapr run --port 3006 -- \
* dapr run --components-path ./components --port 3006 -- \
* java -jar examples/target/dapr-java-sdk-examples-exec.jar \
* io.dapr.examples.state.StateClient 'my message'
*/

View File

@ -10,7 +10,7 @@ package io.dapr.it.services;
* <p>
* To run manually, from repo root:
* 1. mvn clean install
* 2. dapr run --grpc-port 41707 --port 32851 -- mvn exec:java -Dexec.mainClass=io.dapr.it.services.EmptyService -Dexec.classpathScope="test" -Dexec.args="-p 44511 -grpcPort 41707 -httpPort 32851" -pl=sdk
* 2. dapr run --components-path ./components --grpc-port 41707 --port 32851 -- mvn exec:java -Dexec.mainClass=io.dapr.it.services.EmptyService -Dexec.classpathScope="test" -Dexec.args="-p 44511 -grpcPort 41707 -httpPort 32851" -pl=sdk
*/
public class EmptyService {

View File

@ -19,7 +19,7 @@ import io.grpc.ManagedChannelBuilder;
* Simple example.
* To run manually, from repo root:
* 1. mvn clean install
* 2. dapr run --grpc-port 50001 -- mvn exec:java -Dexec.mainClass=io.dapr.it.state.HelloWorldGrpcStateService -Dexec.classpathScope="test" -pl=sdk
* 2. dapr run --components-path ./components --grpc-port 50001 -- mvn exec:java -Dexec.mainClass=io.dapr.it.state.HelloWorldGrpcStateService -Dexec.classpathScope="test" -pl=sdk
*/
public class HelloWorldGrpcStateService {