Merge branch 'master' into feature_fix-statestore-serialization

This commit is contained in:
abogdanov37 2021-03-11 22:06:14 +03:00 committed by GitHub
commit 51b44be76d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 110 additions and 17 deletions

View File

@ -200,18 +200,54 @@ Use the follow command to execute the DemoActorClient:
dapr run --components-path ./components/actors --app-id demoactorclient -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.actors.DemoActorClient
```
Once running, the `DemoActorClient` logs will start displaying the different steps:
First, we can see actors being activated:
![actordemo1](../../../../../resources/img/demo-actor-client1.png)
Once running, the `demoactorservice` logs will start displaying the different steps:
First, we can see actors being activated and the `say` method being invoked:
```text
== APP == 2021-03-10 21:08:28,941 {HH:mm:ss.SSS} [http-nio-3000-exec-1] INFO io.dapr.actors.ActorTrace - Actor:b7b8e745-bc1b-44ff-a0d3-c9a71f68956c Activating ...
Then we can see the `registerReminder` in action. `DemoActorClient` console displays the actors handling reminders:
![actordemo2](../../../../../resources/img/demo-actor-client2.png)
== APP == 2021-03-10 21:08:28,941 {HH:mm:ss.SSS} [http-nio-3000-exec-2] INFO io.dapr.actors.ActorTrace - Actor:d0455670-557b-4ff5-ab4c-8743aca9a423 Activating ...
After invoking `incrementAndGet`, the code invokes `say` method (you'll see these messages 10 times per each of the 3 actors):
![actordemo2](../../../../../resources/img/demo-actor-client3.png)
== APP == 2021-03-10 21:08:28,941 {HH:mm:ss.SSS} [http-nio-3000-exec-10] INFO io.dapr.actors.ActorTrace - Actor:56d741b6-b685-45df-974b-9e94efb3e7b4 Activating ...
On the other hand, the console for `DemoActorService` is also responding to the remote invocations:
![actordemo2](../../../../../resources/img/demo-actor-service.png)
== APP == 2021-03-10 21:08:28,941 {HH:mm:ss.SSS} [http-nio-3000-exec-10] INFO io.dapr.actors.ActorTrace - Actor:56d741b6-b685-45df-974b-9e94efb3e7b4 Activated
== APP == 2021-03-10 21:08:28,941 {HH:mm:ss.SSS} [http-nio-3000-exec-1] INFO io.dapr.actors.ActorTrace - Actor:b7b8e745-bc1b-44ff-a0d3-c9a71f68956c Activated
== APP == 2021-03-10 21:08:28,941 {HH:mm:ss.SSS} [http-nio-3000-exec-2] INFO io.dapr.actors.ActorTrace - Actor:d0455670-557b-4ff5-ab4c-8743aca9a423 Activated
== APP == Server say method for actor 56d741b6-b685-45df-974b-9e94efb3e7b4: Actor 56d741b6-b685-45df-974b-9e94efb3e7b4 said message #1 @ 2021-03-10 21:08:29.170
== APP == Server say method for actor b7b8e745-bc1b-44ff-a0d3-c9a71f68956c: Actor b7b8e745-bc1b-44ff-a0d3-c9a71f68956c said message #1 @ 2021-03-10 21:08:29.170
== APP == Server say method for actor d0455670-557b-4ff5-ab4c-8743aca9a423: Actor d0455670-557b-4ff5-ab4c-8743aca9a423 said message #1 @ 2021-03-10 21:08:29.170
```
Then we can see reminders and timers in action:
```text
== APP == Server timer for actor b7b8e745-bc1b-44ff-a0d3-c9a71f68956c: ping! @ 2021-03-10 21:08:32.945
== APP == Server timer for actor d0455670-557b-4ff5-ab4c-8743aca9a423: ping! @ 2021-03-10 21:08:32.945
== APP == Server timer for actor 56d741b6-b685-45df-974b-9e94efb3e7b4: ping! @ 2021-03-10 21:08:32.945
== APP == Server reminded actor b7b8e745-bc1b-44ff-a0d3-c9a71f68956c of: myremind for 1251123938 @ 2021-03-10 21:08:33.007
```
Finally, the console for `demoactorclient` got the service responses:
```text
== APP == Actor 56d741b6-b685-45df-974b-9e94efb3e7b4 got a reply: 2021-03-10 21:08:29.170
== APP == Actor b7b8e745-bc1b-44ff-a0d3-c9a71f68956c got a reply: 2021-03-10 21:08:29.170
== APP == Actor d0455670-557b-4ff5-ab4c-8743aca9a423 got a reply: 2021-03-10 21:08:29.170
== APP == Actor d0455670-557b-4ff5-ab4c-8743aca9a423 got a reply: 2021-03-10 21:08:29.292
== APP == Actor 56d741b6-b685-45df-974b-9e94efb3e7b4 got a reply: 2021-03-10 21:08:29.752
== APP == Actor 56d741b6-b685-45df-974b-9e94efb3e7b4 got a reply: 2021-03-10 21:08:29.804
```
For more details on Dapr SpringBoot integration, please refer to [Dapr Spring Boot](../../../springboot/DaprApplication.java) Application implementation.

View File

@ -197,13 +197,29 @@ dapr run --components-path ./components/bindings --app-id outputbinding -- java
Once running, the OutputBindingExample should print the output as follows:
![publisheroutput](../../../../../../resources/img/outputbinding.png)
```txt
== APP == sending a class with message: Message #0
== APP == sending a plain string: Message #1
== APP == sending a class with message: Message #2
== APP == sending a plain string: Message #3
```
Events have been sent.
Once running, the InputBindingExample should print the output as follows:
![publisherinput](../../../../../../resources/img/inputbinding.png)
```txt
== APP == Received message through binding: {"message":"Message #0"}
== APP == Received message through binding: "Message #1"
== APP == Received message through binding: {"message":"Message #2"}
== APP == Received message through binding: "Message #3"
```
Events have been retrieved from the binding.

View File

@ -78,7 +78,39 @@ dapr run --app-id exception_example -- java -jar target/dapr-java-sdk-examples-e
Once running, the OutputBindingExample should print the output as follows:
![stateouput](../../../../../resources/img/exception.png)
```txt
== APP == Error code: INVALID_ARGUMENT
== APP == Error message: INVALID_ARGUMENT: state store Unknown state store is not found
== APP == io.dapr.exceptions.DaprException: INVALID_ARGUMENT: state store Unknown state store is not found
== APP == at io.dapr.exceptions.DaprException.propagate(DaprException.java:168)
== APP == at io.dapr.client.DaprClientGrpc$2.onError(DaprClientGrpc.java:716)
== APP == at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478)
== APP == at io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:464)
== APP == at io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:428)
== APP == at io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:461)
== APP == at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:617)
== APP == at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
== APP == at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:803)
== APP == at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:782)
== APP == at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
== APP == at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
...
```
### Cleanup

View File

@ -158,11 +158,16 @@ dapr run --app-id invokeclient -- java -jar target/dapr-java-sdk-examples-exec.j
<!-- END_STEP -->
Once running, the output should display the messages sent from invoker in the demo service output as follows:
Finally, the console for `invokeclient` should output:
![exposeroutput](../../../../../../resources/img/exposer-service.png)
```text
== APP == "message one" received
Method have been remotely invoked and displaying the remote messages.
== APP == "message two" received
== APP == Done
```
For more details on Dapr Spring Boot integration, please refer to [Dapr Spring Boot](../../DaprApplication.java) Application implementation.

View File

@ -265,9 +265,13 @@ Execute the follow script in order to run the InvokeClient example, passing two
```sh
dapr run -- java -jar target/dapr-java-sdk-examples-exec.jar io.dapr.examples.tracing.InvokeClient "message one" "message two"
```
Once running, the output should display the messages sent from invoker in the demo service output as follows:
Open the `tracingdemo` console and check the output as follows:
![exposeroutput](https://raw.githubusercontent.com/dapr/java-sdk/master/examples/src/main/resources/img/exposer-service.png)
```txt
== APP == Server: "\"message one\"" @ 2021-03-10 22:10:23.598 and metadata: {"user-agent":"okhttp/4.9.0","host":"127.0.0.1:3000","content-type":"application/json; charset=utf-8","content-length":"17","connection":"Keep-Alive","x-daprrequestid":"00d801df-2773-4b9d-b389-12d0a93d6b90","accept-encoding":"gzip","x-forwarded-for":"192.168.1.15","x-forwarded-host":"X","forwarded":"for=192.168.1.15;by=192.168.1.15;host=X","traceparent":"00-4659182fd55c552b84fa291e3157d215-d0145c33df26c04d-01"}
== APP == Server: "\"message two\"" @ 2021-03-10 22:10:24.690 and metadata: {"user-agent":"okhttp/4.9.0","host":"127.0.0.1:3000","content-type":"application/json; charset=utf-8","content-length":"17","forwarded":"for=192.168.1.15;by=192.168.1.15;host=X","connection":"Keep-Alive","accept-encoding":"gzip","x-forwarded-host":"X","x-daprrequestid":"7ef1e4d5-fab5-4375-98cc-0268d22504f0","x-forwarded-for":"192.168.1.15","traceparent":"00-4659182fd55c552b84fa291e3157d215-92beb2b9df7e1450-01"}
```
Method have been remotely invoked and displaying the remote messages.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB