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

CloudEvents support #673

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

clemensv
Copy link
Contributor

#do-not-merge

This PR adds CloudEvents support addressing #671.

I had to move the cheese a bit in the RSS feed area, though, because I need an endpoint for an event consumer to fetch the full content from. I'm assuming that we can't route the entire text of all posts through the eventing channel.

Base feed still at ./feed/rss

  • (new) ./feed/rss/{id} newly returns an RSS item with inlined content (as when the AlwaysIncludeContentInRSS option is turned on). I also fixed an issue with XHTML encoding since XHTML doesn't like HTML entities undecoded.
  • (changed) ./feed/rss/{id}/comments switched from ./feed/rss/comments/{id}
  • (changed) ./feed/rss/tags/{categoryid}/rss switched from ./feed/rss/{categoryid}

In config, you enable the CloudEvents support with

 <EnableCloudEvents>false</EnableCloudEvents>

and you need to add one or more HTTPS target endpoints to deliver those events to. That is currently done synchronously, inline with posting the item, but should be very fast with an event broker.

The targets are configured with a <CloudEventsTargets> element that can hold one or more targets. The Uri holds the target Uri, the Headers collection holds name/value pairs for HTTP headers to add to the request. Here, I show an Event Grid SAS key header.

<CloudEventsTargets>
      <CloudEventsTarget>
        <ProfileName>eventGrid</ProfileName>
        <Uri>https://{myns}.westeurope-1.eventgrid.azure.net/api/events</Uri>
        <Headers>
          <Header>
            <Name>aeg-sas-key</Name>
            <Value>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Value>
          </Header>
        </Headers>
      </CloudEventsTarget>
  </CloudEventsTargets>

@poppastring
Copy link
Owner

@clemensv I am holding off on this until you give me the all clear for another review.

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.

None yet

2 participants