Mossharbor / AzureWorkArounds.ServiceBus

Implmentations of Missing Dotnet Core Azure Service Bus functionality around Queues/Topics/Subsccriptions/Event Hubs
MIT License
6 stars 4 forks source link

Correlation Filters do not allow user options to be specified when creating a topic. #2

Open Mossharbor opened 6 years ago

Mossharbor commented 6 years ago

This should work, but currently we do not serialize the xml correctly. Other fields in the Correlation filters do work.

            var filter = new CorrelationFilter("1234");
            filter.Properties["prop1"] = "abc"; //from message.Properties["prop1"] = "abc";
            filter.Properties["prop2"] = "xyz";
            namespaceManager.CreateSubscription(sd, filter);
Mossharbor commented 6 years ago

The xml should look like this:

<SubscriptionDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
      <DefaultRuleDescription>
        <Filter i:type="CorrelationFilter">
          <CorrelationId>1234</CorrelationId>
          <Properties>
            <KeyValueOfstringanyType>
              <Key>prop1</Key>
              <Value xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">abc</Value>
            </KeyValueOfstringanyType>
            <KeyValueOfstringanyType>
              <Key>prop2</Key>
              <Value xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">xyz</Value>
            </KeyValueOfstringanyType>
          </Properties>
        </Filter>
        <Action i:type="EmptyRuleAction" />
        <Name>$Default</Name>
      </DefaultRuleDescription>
    </SubscriptionDescription>