edwinvw / dapr-workshop Goto Github PK
View Code? Open in Web Editor NEWWorkshop that teaches how to apply Dapr to an existing .NET, Java or Python based microservices application.
Workshop that teaches how to apply Dapr to an existing .NET, Java or Python based microservices application.
Not sure if this is a really good idea.
Since we have the same HTTP contracts everywhere we could ask people to change things up and combine a bit of Java with .NET (and python when that's ready).
I would add this as a bonus objective as this requires people to know a bit about running apps for different languages.
For this java tutorial, Assignment #3, the tutorial would be easier to follow if the following 2 steps are swapped, as the current order creates an error initially, and then the error gets resolved in a later step, which can be confusing or misleading to someone following the tutorial:
This step to declare a Spring Bean makes the IDE throw an error
should be swapped (or come before) this step to add a constructor to resolve the error
In assignment - 07 one of the instruction is to initialize the lincense_key
variable by reading the secret from the secret store is not working.
The current form of the instruction simply asks us to assign the secret directly to the license_key
variable as shown below.
with DaprClient() as dapr_client:
license_key = dapr_client.get_secret("trafficcontrol-secrets", "finecalculator.licensekey").secret
However, this won't work as the returned value is a dict and the FineCalculator
expects a string license key (code).
Changing the code to the following works in my case.
with DaprClient() as client:
license_key = client.get_secret("trafficcontrol-secrets", "finecalculator.licensekey").secret["finecalculator.licensekey"]
This needs to be verified and updated in the instruction for assignment-07 [Python].
BTW, thanks for this wonderful workshop.. ๐
Thanks for your great example!
I am wondering do you plan to implement polyglot languages(For example, Traffic control service in C#, Fine collection Service in Java), and the service invocation over RabbitMQ?
I have dapr version (CLI version: 1.7.1 , Runtime version: 1.7.3) & dotnet version 6.0.300
I bumped into the workshop, which is very well-created.
Erroring out on assignment with the first change of changing proxy URL to "http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/{licenseNumber}");
Both vehicleregistration and finecollection service are in run state. The finecollection error out calling vehicleregistration
== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[100]
== APP == Start processing HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79
== APP == info: System.Net.Http.HttpClient.Default.ClientHandler[100]
== APP == Sending HTTP request GET http://localhost:3601/v1.0/invoke/vehicleregistrationservice/method/vehicleinfo/TX-TS-79
== APP == info: System.Net.Http.HttpClient.Default.ClientHandler[101]
== APP == Received HTTP response headers after 1001.5905ms - 500
== APP == info: System.Net.Http.HttpClient.Default.LogicalHandler[101]
== APP == End processing HTTP request after 1001.7241ms - 500
== APP == fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
== APP == An unhandled exception has occurred while executing the request.
== APP == System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
== APP == at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
== APP == at System.Net.Http.Json.HttpClientJsonExtensions.GetFromJsonAsyncCore[T](Task1 taskResponse, JsonSerializerOptions options, CancellationToken cancellationToken) == APP == at FineCollectionService.Proxies.VehicleRegistrationService.GetVehicleInfo(String licenseNumber) in /Users/manrawat1/projects/daprwork/dapr-workshop-csharp/FineCollectionService/Proxies/VehicleRegistrationService.cs:line 14 == APP == at FineCollectionService.Controllers.CollectionController.CollectFine(SpeedingViolation speedingViolation) in /Users/manrawat1/projects/daprwork/dapr-workshop-csharp/FineCollectionService/Controllers/CollectionController.cs:line 33 == APP == at lambda_method4(Closure , Object ) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) == APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
== APP == at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
== APP == at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
== APP == at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Context
In the step-by-step instructions for Assignment 1, screenhots are used to show how to open a new terminal window (step 2.2) and select a different terminal window (step 3.8) in VS Code.
Issue
Although these screenshots indicate the right buttons to click, they show dotnet
as the running process. This might confuse Java devs following the instructions.
Proposed solution
Make new screenshots that show the correct running process (probably mvn
??).
Noticed this issue while reviewing @mthmulders Java merge request, but goes for the .NET side as well.
The workshop contains quite a few images which contain code/logs which can't be read by screenreaders.
The general moto in the A11Y world seems to be "Code blocks, not screenshots". This would also make it easier to version (in case some of the examples ever change, we don't need to create new screenshots.
Very open to discuss this further and contribute.
Dapr v1.4 is now available. I think it would be good to update the workshop instructions so the latest bits are pulled in. Let's keep this one as an umbrella issue and have pull requests for the separate tracks?
I've run into this on my Linux machine, where I'm developing the Java track for this workshop. After starting the Mosquitto container, I noticed that the ownership of the Mosquitto folder would have changed to 1883:1883
.
The Mosquitto container is started with the current directory mounted into the container as /mosquitto/config/
. As I understand from eclipse/mosquitto/issues/1078, the container will indeed change ownership of /mosquitto
to mosquitto:mosquitto
(to be precise, it happens in the docker-entrypoint.sh script.
I'm not sure if this is actually something that you can observe on Windows (I hardly ever use that operating system) but at least it happens on Linux and probably also on macOS, and I consider it a bit annoying. Would you be accepting a PR that addresses this, e.g. by copying over the configuration files to a temporary directory and then mounting that one into the Mosquitto container?
The best place to learn Dapr that I have found.
Thank you
I'm using WSL2 as the backend for my docker desktop installation. When I boot the mosquitto container it fails because it can't parse the configuration file. After some debugging I found that the line endings are CRLF instead of LF. This causes issues in WSL2.
In Step-06 of assignment-03[python], the third instruction has /dapr/dubscribe
instead of /dapr/subscribe
๐
Hi and thanks alot for the work shop! To code along with the instructions for the Java SDK is a joy and it's a very fun way to explore Dapr.
A suggestion is to clarify the below section a bit though.
After the instrcution I suggest that the whole method should
shown to avoid any missunderstanding.
I guess it should look something like this?
@Topic(name = "speedingviolations", pubsubName = "pubsub")
public ResponseEntity<Void> registerViolation(@RequestBody final CloudEvent<SpeedingViolation> event) {
violationProcessor.processSpeedingViolation(event.getData());
return ResponseEntity.ok().build();
}
Thanks again,
Regards
Dan
The Dapr SDK for Java does not support distributed tracing out of the box (see dapr/java-sdk#650). That's why it wasn't working in this workshop, either. I feel we should show attendees how to get it working - even if it's not the cleanest approach.
I will propose a few textual changes that go with mthmulders/dapr-workshop-java@8f99f85. This will make sure that when people follow this workshop, they will be able to see how distributed tracing works with Zipkin.
Dapr Traffic Control Demo of Dapr actors
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.