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

Cloud events + publishing to Azure Service Bus #143

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

EtherZa
Copy link
Contributor

@EtherZa EtherZa commented Feb 8, 2023

This PR is a little larger that I would like it to be as I never intended for it to be merged upstream due to some breaking changes. It also includes multiple features.

Having said that; it may be useful and as such will leave it to you to include, decline, break apart or just ignore.

Changes:

  • Publish to Azure Service Bus topic/queue
    • With support for adding static/dynamic delivery properties as per Azure Event Grid
  • Cloud Events
    • Configured per topic
    • Routing is maintained (ie. /api/events for both cloud events and the default. Topic matched by port.)
  • Publish assertions using RichardSzalay.MockHttp
  • Uses System.Text.Json where possible, but falls back to Newtonsoft for JsonPath queries

Breaking changes:

  • In order to facilitate multiple subscriber classes, sub-categories have been added to the topic's subscribers section.
{
      "name": "ATopicThatPushesToBothRequestCatcherAndAzureServiceBus",
      "port": 60105,
      "key": "TheLocal+DevelopmentKey=",
      "subscribers": {
        "http": [
          {
            "name": "RequestCatcherSubscription",
            "endpoint": "https://azureeventgridsimulator.requestcatcher.com",
            "disableValidation": true
          }
        ],
        "serviceBus": [
          {
            "name": "SVB",
            "namespace": "azure-service-bus-namespace",
            "sharedAccessKeyName": "RootManageSharedAccessKey",
            "sharedAccessKey": "ServiceBusSharedKey==",
            "topic": "sample-topic-or-queue-name",
            "properties": {
              "eTag": {
                "type": "dynamic",
                "value": "data.eTag"
              },
              "Label": {
                "type": "dynamic",
                "value": "Subject"
              },
              "CustomProperty": {
                "type": "static",
                "value": "Custom property value"
              }
            }
          }
        ]
      }
    }

Apologies again for the behemoth submission. Please do with it as you see fit.

Richard

@jsommr
Copy link

jsommr commented Mar 9, 2024

Awesome work! May I ask why it never got merged? Seems insanely useful.

@EtherZa
Copy link
Contributor Author

EtherZa commented Mar 9, 2024

Awesome work! May I ask why it never got merged? Seems insanely useful.

I suspect due to it being unsolicited and introducing a breaking change (configuration schema), but I never heard anymore.

I see that some conflicts have now crept in too.

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.

2 participants