Skip to content

Conversation

@kapilthareja
Copy link

@kapilthareja kapilthareja commented Oct 24, 2025

  • Enhance bulk publish to support raw byte array payload

Description

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.

Issue reference

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.

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:

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

* Enhance bulk publish to support raw byte array payload

Signed-off-by: Kapil Thareja <[email protected]>
@kapilthareja kapilthareja marked this pull request as ready for review October 24, 2025 18:43
@kapilthareja kapilthareja requested review from a team as code owners October 24, 2025 18:43
@kapilthareja
Copy link
Author

Please note that I closed previous PRs for similar changes due to unnecessary formatting modifications. It was more efficient to raise a new PR than to spend time correcting those issues.

@kapilthareja
Copy link
Author

Hi @WhitWaldo,
Any suggestion on next steps please ?

@WhitWaldo
Copy link
Contributor

I'll take a look as soon as I've got a minute and review. Juggling a lot of plates right now - sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants