Skip to content

Request-response MQTT service clients #619

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

Merged
merged 28 commits into from
Jun 27, 2025
Merged

Conversation

bretambrose
Copy link
Contributor

@bretambrose bretambrose commented May 19, 2025

  • Adds request-response service clients for the Shadow, Jobs, and Identity services
  • Moves samples that use the old clients to a deprecated folder
  • Adds new samples for each service that use the request-response clients

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sbSteveK
Copy link
Contributor

Trivial: Some explanation of what this PR is adding/doing to the summary and maybe a more descriptive title for the PR.

@@ -0,0 +1,84 @@
# Jobs
Copy link
Contributor

Choose a reason for hiding this comment

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

Trivial: May not be worthwhile but maybe we could add a comment at the start of the deprecated sample .md files that state this sample is deprecated with a link to the current service client outside of the deprecated folder. Might not be worth the trouble though since to see this, someone would have to come looking specifically in the deprecated folder....

On a side note, should we simply remove these from existence since they're just samples that we don't want anyone using?


def handle_get(context : SampleContext):
request = iotshadow.GetShadowRequest(thing_name = context.thing)
response = context.shadow_client.get_shadow(request).result()
Copy link
Contributor

Choose a reason for hiding this comment

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

debatable: In all the sandbox samples, rejected requests end up being caught by the try block in main where the input is being handled. I think for the sake of clarity to the customer and showing how a rejected response can be handled we should handle the exception explicitly, per helper function. Or at least in some way where we grab and print out the elements of a rejected request. e.g. the message, error code, timestamp, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like going in this direction complicates the sample for not much value.

Copy link
Contributor

@sbSteveK sbSteveK left a comment

Choose a reason for hiding this comment

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

Some trivial fixes and suggestions as well as maybe expanded documentation from codegen but functionally solid. Address and ship

@bretambrose bretambrose changed the title Request response workspace2 Request-response MQTT service clients Jun 27, 2025
@bretambrose bretambrose merged commit 5fd586a into main Jun 27, 2025
10 of 12 checks passed
@bretambrose bretambrose deleted the RequestResponseWorkspace2 branch June 27, 2025 20:40
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.

2 participants