Skip to content

Initial Bulk Subscribe functionality#1009

Merged
halspang merged 2 commits into
dapr:release-1.10from
yash-nisar:bulk_subscribe
Feb 8, 2023
Merged

Initial Bulk Subscribe functionality#1009
halspang merged 2 commits into
dapr:release-1.10from
yash-nisar:bulk_subscribe

Conversation

@yash-nisar

@yash-nisar yash-nisar commented Jan 12, 2023

Copy link
Copy Markdown
Contributor

Signed-off-by: Yash Nisar [email protected]

Description

Initial Bulk Subscribe implementation

Please explain the changes you've made

Issue reference

We strive to have all PR 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: #958

Checklist

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

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@yash-nisar
yash-nisar requested review from a team as code owners January 12, 2023 03:36
@codecov

codecov Bot commented Jan 12, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1009 (72e426f) into release-1.10 (c863582) will decrease coverage by 0.51%.
The diff coverage is 42.30%.

@@               Coverage Diff                @@
##           release-1.10    #1009      +/-   ##
================================================
- Coverage         69.45%   68.95%   -0.51%     
================================================
  Files               162      169       +7     
  Lines              5432     5534     +102     
  Branches            585      588       +3     
================================================
+ Hits               3773     3816      +43     
- Misses             1519     1578      +59     
  Partials            140      140              
Flag Coverage Δ
net6 68.86% <42.30%> (-0.52%) ⬇️
net7 68.86% <42.30%> (-0.52%) ⬇️
netcoreapp3.1 68.91% <42.30%> (-0.51%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Dapr.AspNetCore/BulkMessageModel.cs 0.00% <0.00%> (ø)
src/Dapr.AspNetCore/BulkSubscribeAppResponse.cs 0.00% <0.00%> (ø)
...c/Dapr.AspNetCore/BulkSubscribeAppResponseEntry.cs 0.00% <0.00%> (ø)
src/Dapr.AspNetCore/BulkSubscribeMessage.cs 0.00% <0.00%> (ø)
src/Dapr.AspNetCore/BulkSubscribeMessageEntry.cs 0.00% <0.00%> (ø)
src/Dapr.AspNetCore/BulkSubscribeTopicOptions.cs 0.00% <0.00%> (ø)
...NetCore/DaprEndpointConventionBuilderExtensions.cs 30.30% <0.00%> (-8.16%) ⬇️
src/Dapr.AspNetCore/BulkSubscribeAttribute.cs 100.00% <100.00%> (ø)
...r.AspNetCore/DaprEndpointRouteBuilderExtensions.cs 94.24% <100.00%> (+1.14%) ⬆️
src/Dapr.AspNetCore/Subscription.cs 93.75% <100.00%> (+2.08%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines 99 to 101

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that we were able to reuse the metadata here. Is it possible to make a more convenient function for this? Or a [BulkSubscribeTopicMetadata] that flows through the same path? I know we originally didn't want a new annotation but I was just thinking if we follow the path of the metadata but provide a convenient annotation for it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just one point here, bulk subscribe is no longer part of metadata, but it is its own field similar to route in subscriptions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit, indentation doesn't need to be here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How does this look as an actual payload coming in? My hope is that it would be an array of the actual events so we don't need the CloudEventModel in the middle as that's the point of this middleware is to remove the cloudevent.

Below we just reference the data field for example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline and addressed. The reason being, if we just reference data, we might not get other information like entryId. These fields might be important as they tell the consumer which message failed/passed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally, publicly accessible fields should be capitalized also this should be Entries or something like that since you need the individual entry to get the status.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No data? Where is that stored?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread src/Dapr.AspNetCore/DaprBulkMessage.cs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the empty constructor for?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this is the actual response back? Or what we send out? I was confused with how DaprBulkAppResponse didn't have any events.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DaprBulkAppResponse is the response that we send back to dapr.

Comment on lines 99 to 101

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just one point here, bulk subscribe is no longer part of metadata, but it is its own field similar to route in subscriptions.

Comment on lines 19 to 20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
/// Response from the application containing status for each entry in the bulk message.
/// It is posted by the bulk subscribe handler.
/// Response from the application containing status for each entry in the bulk message.
/// It is posted to the bulk subscribe handler.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ideally this enum can be used for normal subscribe response to, if there is a domain model for normal subscribe response ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We don't have that yet.

@yash-nisar
yash-nisar force-pushed the bulk_subscribe branch 3 times, most recently from de99401 to 8e3a2d4 Compare February 6, 2023 17:19
@yash-nisar
yash-nisar requested review from halspang and mukundansundar and removed request for halspang and mukundansundar February 6, 2023 17:25

@halspang halspang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mostly just questions/formatting stuff.

Comment thread examples/AspNetCore/ControllerSample/Controllers/SampleController.cs Outdated
Comment thread examples/AspNetCore/ControllerSample/Controllers/SampleController.cs Outdated
Comment thread examples/AspNetCore/ControllerSample/Controllers/SampleController.cs Outdated
Comment thread examples/AspNetCore/ControllerSample/Controllers/SampleController.cs Outdated
Comment thread examples/AspNetCore/ControllerSample/README.md Outdated
Comment thread src/Dapr.AspNetCore/BulkSubscribeAppResponseEntry.cs Outdated
Comment thread src/Dapr.AspNetCore/BulkSubscribeAttribute.cs Outdated
Comment thread src/Dapr.AspNetCore/BulkSubscribeAttribute.cs Outdated
Comment thread test/Dapr.AspNetCore.IntegrationTest.App/DaprController.cs Outdated
Comment thread src/Dapr.AspNetCore/DaprEndpointRouteBuilderExtensions.cs Outdated
@yash-nisar
yash-nisar requested a review from halspang February 7, 2023 22:44
@halspang
halspang changed the base branch from master to release-1.10 February 7, 2023 23:51
@halspang

halspang commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

@mukundansundar - Can you validate this to make sure we aren't missing anything?

@mukundansundar mukundansundar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bulk subscribe lgtm

@halspang
halspang merged commit 0f1e1bf into dapr:release-1.10 Feb 8, 2023
@yash-nisar
yash-nisar deleted the bulk_subscribe branch February 8, 2023 18:53
yash-nisar added a commit to yash-nisar/dotnet-sdk that referenced this pull request Feb 27, 2023
yash-nisar added a commit to yash-nisar/dotnet-sdk that referenced this pull request Feb 27, 2023
halspang pushed a commit that referenced this pull request Feb 27, 2023
* Update DurableTask SDK dependency to get ARM64 compatibility (#1024) (#1025)

* Update DurableTask SDK dependency to get ARM64 compatibility

* Fix issue with gRPC address override behavior

Signed-off-by: Chris Gillum <[email protected]>

* Initial Bulk Subscribe functionality (#1009)

Signed-off-by: Yash Nisar <[email protected]>

* Workflow unit testing changes for 1.10 release (#1038)

Signed-off-by: Chris Gillum <[email protected]>

* Fix issue with gRPC address override behavior

Signed-off-by: Chris Gillum <[email protected]>

* Workflow SDK changes to enable unit testing

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

Bulk Pubsub implementation in SDK

3 participants