-
Notifications
You must be signed in to change notification settings - Fork 530
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
Code example for Pubsub component using Dapr Java SDK #529
Conversation
…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]>
Signed-off-by: Nick Greenfield <[email protected]>
Add http example for JavaScript pubsub
Signed-off-by: Nick Greenfield <[email protected]>
Signed-off-by: Nick Greenfield <[email protected]>
Remove quickstarts that need to be redone
Signed-off-by: Pravin Pushkar <[email protected]>
pub_sub/java/sdk/README.md
Outdated
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
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.
...k/order-processor/src/main/java/com/service/controller/OrderProcessingServiceController.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
pub_sub/java/sdk/checkout/src/main/java/com/service/CheckoutServiceApplication.java
Outdated
Show resolved
Hide resolved
pub_sub/java/sdk/checkout/src/main/java/com/service/CheckoutServiceApplication.java
Outdated
Show resolved
Hide resolved
...k/order-processor/src/main/java/com/service/controller/OrderProcessingServiceController.java
Show resolved
Hide resolved
return new ResponseEntity<>("successful", | ||
HttpStatus.OK); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
pub_sub/java/sdk/checkout/src/main/java/com/service/CheckoutServiceApplication.java
Show resolved
Hide resolved
Signed-off-by: Pravin Pushkar <[email protected]>
There was a problem hiding this 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
2201192
to
d799eb0
Compare
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: