Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
#region CAP implementation
  string connectString = Configuration.GetValue<string>("ConnectionStrings:PostgreSql");
  string? schema = Assembly.GetEntryAssembly()?.GetName().Name?.ToLower();
            services.AddCap(x =>
              {
                  x.UseAzureServiceBus(opt =>
                  {
                      opt.ConnectionString = Configuration.GetValue<string>("AzureServiceBus:ConnectionString");
                      opt.TopicPath = Configuration.GetValue<string>("AzureServiceBus:TopicName");
                      opt.SubscriptionToTopics = Configuration.GetSection("AzureServiceBus:SubscriptionToTopics")
                      .GetChildren().ToDictionary(x => x.Key, x => x.Value);
                  });
                  x.DefaultGroupName = Configuration.GetValue<string>("AzureServiceBus:Subscription");
                  x.FailedRetryCount = Configuration.GetValue<int>("AzureServiceBus:FailedRetryCount");
                  x.FailedRetryInterval = Configuration.GetValue<int>("AzureServiceBus:FailedRetryInterval");
                  x.UsePostgreSql(x => { x.ConnectionString = connectString; x.Schema = schema; });
              });

#endregion

Note: if you have an error in the line 3, please add using System.Reflection;

Publishing and Subscribing Messages

...

Selected CAP library supports OutBox and InBox Pattern on top of Event Driven out of box. The idea behind this pattern ensures that the message will be not lost if we lose the network, for example.

...

When Application starts, CAP library will automatically generate two tables named Published and Received under application schemas as default based on storage type we configured in startsup.

...

·        Project Repository: EDASampleApi

·        Cross platform EDA white paper: Power App integrate with .NET through EDA

·        CAP library Page: https://cap.dotnetcore.xyz

...