Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update .net code tab on pubsub quickstart #3547

Closed
wants to merge 2 commits into from
Closed

Conversation

paul42
Copy link

@paul42 paul42 commented Jun 14, 2023

Please follow this checklist before submitting:

  • [? unclear can't read 'learn more' link from inside PR creation window ] Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • [✔️ ] Read the contribution guide
  • [N/A ] Commands include options for Linux, MacOS, and Windows within codetabs
  • [N/A ] New file and folder names are globally unique
  • [N/A] Page references use shortcodes instead of markdown or URL links
  • [N/A ] Images use HTML style and have alternative text
  • [N/A ] Places where multiple code/command options are given have codetabs

In addition, please fill out the following to help reviewers understand this pull request:

Description

updated .net code tab quickstart for pubsub - previously when running the quickstart as is, the 'checkout' will not properly send messages - I believe this is because in the sdk\order-processor folder there is a properties and launchSettings.json file with this entry:

"applicationUrl": "http://localhost:7006"

when I add --app-port 7006 I am then able to see the entries show up on the order-processor tab. however, if I omit the --app-port I get a warning on the checkout side:
level=warning msg="App channel is not initialized. Did you configure an app-port?"
when I do put in matching app-port on checkout side, I get this message instead:
level=info msg="application discovered on port 7006"

I'm assuming that this is the correct way to operate and that I'm not accidentally wiring two services together, going against the usual dapr pattern?

in the dotnet section, the order-processor had `--app-port 7005` which was missing from the checkout, and it didn't work on my machine until I added `--app-port 7005` 

if you do not include the `--app-port 7005` on the checkout, you get this warning when doing the `dapr run`:
`level=warning msg="App channel is not initialized. Did you configure an app-port?" app_id=checkout`

Signed-off-by: Paul.42 <[email protected]>
strangely enough the ordering of parameters on the checkout command affect if the quickstart functions properly or not?

Signed-off-by: Paul.42 <[email protected]>
@paul42 paul42 requested review from a team as code owners June 14, 2023 23:26
@paul42 paul42 changed the title Patch 1 Update .net code tab on pubsub quickstart Jun 14, 2023
@yaron2
Copy link
Member

yaron2 commented Jun 14, 2023

@paulyuk please review

@msfussell
Copy link
Member

@paul42 - Do you know how the launchsettings.json for the checkout service got there (on your machine), since it is not checked in to the Quickstarts repo here https://github.com/dapr/quickstarts/tree/master/pub_sub/csharp/sdk/checkout
(Unlike order processor where it is https://github.com/dapr/quickstarts/tree/master/pub_sub/csharp/sdk/order-processor/Properties)

Copy link
Contributor

@paulyuk paulyuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments

@@ -423,7 +423,7 @@ dotnet build
Run the `checkout` publisher service alongside a Dapr sidecar.

```bash
dapr run --app-id checkout --resources-path ../../../components -- dotnet run
dapr run --app-id checkout --app-port 7006 --resources-path ../../../components -- dotnet run
Copy link
Contributor

@paulyuk paulyuk Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea here, just two things:

  1. this change should be applied to the dapr run on order-processor - since that is the receiver of the POST/message. Is that what you meant to do?
  2. we should use port 7006 and match the code exactly in the pub_sub quickstart
  3. if you set up Run/debug via launch.json please have that patch and name match the code. However in future my plan is to use dapr.yaml and dapr run -f . for all of this which will remove tedious steps and issues.

The source of truth is here. @msfussell and @hhunter-ms note the docs have drifted a bit from readmes and I suggest we coordinate an update.
https://github.com/dapr/quickstarts/tree/master/pub_sub/csharp/sdk

@paulyuk
Copy link
Contributor

paulyuk commented Jun 16, 2023

@paul42 - Do you know how the launchsettings.json for the checkout service got there (on your machine), since it is not checked in to the Quickstarts repo here https://github.com/dapr/quickstarts/tree/master/pub_sub/csharp/sdk/checkout (Unlike order processor where it is https://github.com/dapr/quickstarts/tree/master/pub_sub/csharp/sdk/order-processor/Properties)

Correct the launch.json (debug launcher file for VSCode) did not from from the quickstart repo code. I'm guessing the user pressed F5/Run and followed the prompts to add the app and port. For launch.json to really work it needs to leverage the dapr.yaml file which is coming in this pr. I would love to consider a VS Code integration for quickstarts just we dont have that yet.

@paul42 would you be ok sharing your entire launch.json? I'm curious what the final result looks like. If you could please clarify how you got one that would also help.

@paul42
Copy link
Author

paul42 commented Jun 16, 2023

hey @paulyuk sorry about my delayed response here (you all are very fast 😅 ) I apologize if I wrote my initial PR poorly, I did not add any launchSettings, I was speculating that the launchSettings in the order-processor folder was causing the issue.

I'll run through the docs and PR, if the dapr run -f is a better way to run things then we can just close this and I'll run through the quickstart when the PR lands, or I can spin through that branch early and test it as a very new person 😅

@github-actions
Copy link

Stale PR, paging all reviewers

@hhunter-ms
Copy link
Collaborator

hhunter-ms commented Jun 27, 2023

@paulyuk @paul42 closing this PR for now

@hhunter-ms hhunter-ms closed this Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants