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

Support publishing other content type than json #724

Open
mtaghavi2005 opened this issue Jul 22, 2021 · 4 comments
Open

Support publishing other content type than json #724

mtaghavi2005 opened this issue Jul 22, 2021 · 4 comments
Milestone

Comments

@mtaghavi2005
Copy link

We are considering to publish custom CloudEvent to the broker, but currently sdk doesn't support it (The only supported content type is json). It would be great if we could do something similar to invokeBinding and pass ContentType and Data in a raw format encapsulated into the request object to the publishAsync method. It can also address #718 as well)

DaprClientGrpc
image

Suggestion:

  public class PublishEventRequest
    {
        public PublishEventRequest(string pubsubName, string topicName)
        {
            ArgumentVerifier.ThrowIfNullOrEmpty(pubsubName, nameof(pubsubName));
            ArgumentVerifier.ThrowIfNullOrEmpty(topicName, nameof(topicName));

            this.PubSubName = pubsubName;
            this.TopicName = topicName;

            this.Metadata = new Dictionary<string, string>();
        }

        public string PubSubName { get; }

        public string TopicName { get; }

        public ReadOnlyMemory<byte> Data { get; set; }

        public string DataContentType { get; set; }

        public Dictionary<string, string> Metadata { get; }
    }
    
Task PublishEventAsync(PublishEventRequest publishEventRequest, CancellationToken cancellationToken = default)
@fabistb
Copy link

fabistb commented Jul 22, 2021

@msfussell can you please add this issue to our project?

@halspang halspang added this to the v1.6 milestone Nov 12, 2021
@halspang
Copy link
Contributor

We'll add a new method that will skip the json serialization portion and work on raw bytes instead.

@halspang halspang modified the milestones: v1.6, Future Jan 13, 2022
@rabollin
Copy link

@fabistb - As we discussed in the last call, this issue seems to be really nice to have feature. Please review and close the issue as appropriate.

@fabistb
Copy link

fabistb commented Jun 26, 2023

@rabollin , thanks for getting back here.
I checked with @mtaghavi2005 and this topic isn't relevant from our point of view anymore and the issue can be closed.

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

No branches or pull requests

4 participants