-
Notifications
You must be signed in to change notification settings - Fork 361
feat: Enhance bulk publish to support raw byte array payloads #1645
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
Closed
kapilthareja
wants to merge
14
commits into
dapr:master
from
kapilthareja:MakeBulkPublishRequestByteSupport
Closed
feat: Enhance bulk publish to support raw byte array payloads #1645
kapilthareja
wants to merge
14
commits into
dapr:master
from
kapilthareja:MakeBulkPublishRequestByteSupport
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Summary This pull request enhances the bulk publishing feature to natively support raw byte[] payloads through the generic BulkPublishEventAsync<TValue> method. This provides a unified and efficient way for developers to publish both structured (JSON) and raw binary data in a single bulk operation. Key Changes Enhanced MakeBulkPublishRequest Logic: The internal MakeBulkPublishRequest method in DaprClientGrpc.cs has been updated to inspect the type of each event being published. When an event is a byte[], it is now correctly handled as raw binary data. The Content-Type is set to application/octet-stream, and the payload is sent directly, bypassing JSON serialization. For all other event types, the existing behavior of serializing the payload to JSON is preserved. Added Unit Test: A new test case, BulkPublishEventAsync_CanPublishTopicWithByteArrayEvents, has been added to BulkPublishEventApiTest.cs. This test validates that calling BulkPublishEventAsync with a List<byte[]> correctly constructs the gRPC request with the application/octet-stream content type and ensures the byte payloads are sent unmodified. This change improves the flexibility of the bulk publish API without introducing a new method, making the SDK cleaner and more intuitive.
Contributor
|
@kapilthareja Could you please fix the DCO on your commits? |
Summary This pull request enhances the bulk publishing feature to natively support raw byte[] payloads through the generic BulkPublishEventAsync<TValue> method. This provides a unified and efficient way for developers to publish both structured (JSON) and raw binary data in a single bulk operation. Key Changes Enhanced MakeBulkPublishRequest Logic: The internal MakeBulkPublishRequest method in DaprClientGrpc.cs has been updated to inspect the type of each event being published. When an event is a byte[], it is now correctly handled as raw binary data. The Content-Type is set to application/octet-stream, and the payload is sent directly, bypassing JSON serialization. For all other event types, the existing behavior of serializing the payload to JSON is preserved. Added Unit Test: A new test case, BulkPublishEventAsync_CanPublishTopicWithByteArrayEvents, has been added to BulkPublishEventApiTest.cs. This test validates that calling BulkPublishEventAsync with a List<byte[]> correctly constructs the gRPC request with the application/octet-stream content type and ensures the byte payloads are sent unmodified. This change improves the flexibility of the bulk publish API without introducing a new method, making the SDK cleaner and more intuitive. Signed-off-by: Kapil Thareja <[email protected]>
Signed-off-by: Kapil Thareja <[email protected]>
Signed-off-by: Kapil Thareja <[email protected]>
…m/kapilthareja/dotnet-sdk into MakeBulkPublishRequestByteSupport
Signed-off-by: Kapil Thareja <[email protected]>
…m/kapilthareja/dotnet-sdk into MakeBulkPublishRequestByteSupport
* Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]>
* Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]>
…m/kapilthareja/dotnet-sdk into MakeBulkPublishRequestByteSupport
* Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]>
…m/kapilthareja/dotnet-sdk into MakeBulkPublishRequestByteSupport
…Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]> Enhance bulk publish to support raw byte array payload (dapr#1645) * Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]> Signed-off-by: kapilthareja <[email protected]>
kapilthareja
added a commit
to kapilthareja/dotnet-sdk
that referenced
this pull request
Oct 24, 2025
* Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]>
WhitWaldo
pushed a commit
that referenced
this pull request
Nov 7, 2025
* Enhance bulk publish to support raw byte array payload Signed-off-by: Kapil Thareja <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request enhances the bulk publishing feature to natively support raw byte[] payloads through the generic BulkPublishEventAsync method. This provides a unified and efficient way for developers to publish both structured (JSON) and raw binary data in a single bulk operation.
Key Changes
Enhanced MakeBulkPublishRequest Logic: The internal MakeBulkPublishRequest method in DaprClientGrpc.cs has been updated to inspect the type of each event being published.
This change improves the flexibility of the bulk publish API without introducing a new method, making the SDK cleaner and more intuitive.
Description
When an event is a byte[], it is now correctly handled as raw binary data. The Content-Type is set to application/octet-stream, and the payload is sent directly, bypassing JSON serialization. For all other event types, the existing behavior of serializing the payload to JSON is preserved. Added Unit Test: A new test case, BulkPublishEventAsync_CanPublishTopicWithByteArrayEvents, has been added to BulkPublishEventApiTest.cs. This test validates that calling BulkPublishEventAsync with a List<byte[]> correctly constructs the gRPC request with the application/octet-stream content type and ensures the byte payloads are sent unmodified.
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: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: