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

Code example for Pubsub component using Dapr Java SDK #529

Conversation

pravinpushkar
Copy link
Contributor

Signed-off-by: Pravin Pushkar [email protected]

Description

Code example for pubsub component using Dapr java SDK

Issue reference

We strive to have all PRs being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: NA

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • The quickstart code compiles correctly
  • You've tested new builds of the quickstart if you changed quickstart code
  • You've updated the quickstart's README if necessary
  • If you have changed the steps for a quickstart be sure that you have updated the automated validation accordingly. All of our quickstarts have annotations that allow them to be executed automatically as code. For more information see mechanical-markdown. For user guide with examples see Examples.

paulyuk and others added 23 commits February 6, 2022 21:33
…quickstarts-examples into paulyuk/quickstartfeedback
Adding HTTP quickstarts for Python and .NET (C#)
Signed-off-by: Nick Greenfield <[email protected]>
Signed-off-by: Nick Greenfield <[email protected]>
Signed-off-by: Nick Greenfield <[email protected]>
Remove quickstarts that need to be redone
@@ -0,0 +1,60 @@
# Dapr pub/sub

In this quickstart, you'll create a publisher microservice and a subscriber microservice to demonstrate how Dapr enables a publish-subcribe pattern. The publisher will generate messages of a specific topic, while subscribers will listen for messages of specific topics. See [Why Pub-Sub](#why-pub-sub) to understand when this pattern might be a good choice for your software architecture.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In this quickstart, you'll create a publisher microservice and a subscriber microservice to demonstrate how Dapr enables a publish-subcribe pattern. The publisher will generate messages of a specific topic, while subscribers will listen for messages of specific topics. See [Why Pub-Sub](#why-pub-sub) to understand when this pattern might be a good choice for your software architecture.
In this quickstart, you'll create a publisher microservice and a subscriber microservice that demonstrates how Dapr enables a publish-subscribe pattern. The publisher will publish messages to a specific topic, while subscribers will listen for messages from a specific topic. See [Why Pub-Sub](#why-pub-sub) to understand when this pattern might be a good choice for your software architecture.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have similar wordings at other examples, So to keep it consistent I have used similar wordings.

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 a few of the comments and suggestions.

return new ResponseEntity<>("successful",
HttpStatus.OK);
} catch (Exception e) {
throw new RuntimeException(e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it normal to show try catch with a rethrow? or just cut the try catch?

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 think yes, it is fine to write and here I wanted to throw if there is any unchecked exception happened like the cloudEvent.getData comes out to be null.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

Signed-off-by: Pravin Pushkar <[email protected]>
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.

LGTM. thank you for addressing the feedback

@artursouza artursouza closed this Feb 15, 2022
@artursouza artursouza force-pushed the feature/new_quickstarts branch from 2201192 to d799eb0 Compare February 15, 2022 00:00
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.

8 participants