Skip to content

Commit

Permalink
Update libs (#228)
Browse files Browse the repository at this point in the history
* Indented

* Update packages again.

* Update libs again.
  • Loading branch information
SebastianStehle authored Mar 24, 2024
1 parent 27244c6 commit 9dce26a
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AWSSDK.SimpleEmail" Version="3.7.300.59" />
<PackageReference Include="AWSSDK.SimpleEmail" Version="3.7.300.60" />
<PackageReference Include="Confluent.Kafka" Version="2.3.0" />
<PackageReference Include="FirebaseAdmin" Version="2.4.0" />
<PackageReference Include="FluentValidation" Version="11.9.0" />
Expand Down
3 changes: 2 additions & 1 deletion backend/src/Notifo.Domain/Events/EventsServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public static void AddMyEvents(this IServiceCollection services, IConfiguration

services.ConfigureAndValidate<EventsOptions>(config, "events");

services.AddMessaging(new ChannelName(options.ChannelName), true);
services.AddMessaging()
.AddChannel(new ChannelName(options.ChannelName), true);

services.Configure<MessagingOptions>(messaging =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ namespace Microsoft.Extensions.DependencyInjection;

public static class UserEventsServiceExtensions
{
public static void AddMyUserEvents(this IServiceCollection services, IConfiguration config)
public static MessagingBuilder AddMyUserEvents(this MessagingBuilder builder, IConfiguration config)
{
var options = config.GetSection("pipeline:userEvents").Get<UserEventPipelineOptions>() ?? new UserEventPipelineOptions();

services.AddMessaging(new ChannelName(options.ChannelName), true);
builder.AddChannel(new ChannelName(options.ChannelName), true);

services.Configure<MessagingOptions>(messaging =>
builder.Configure(messaging =>
{
messaging.Routing.Add(x => x is UserEventMessage, options.ChannelName);
});

services.AddSingletonAs<UserEventConsumer>()
builder.Services.AddSingletonAs<UserEventConsumer>()
.AsSelf().As<IMessageHandler>();

services.AddSingletonAs<UserEventPublisher>()
builder.Services.AddSingletonAs<UserEventPublisher>()
.As<IUserEventPublisher>();

return builder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,31 @@ namespace Microsoft.Extensions.DependencyInjection;

public static class UserNotificationsServiceExtensions
{
public static void AddMyUserNotifications(this IServiceCollection services, IConfiguration config)
public static MessagingBuilder AddMyUserNotifications(this MessagingBuilder builder, IConfiguration config)
{
var options = config.GetSection("pipeline:confirms").Get<ConfirmPipelineOptions>() ?? new ConfirmPipelineOptions();

services.ConfigureAndValidate<UserNotificationsOptions>(config, "notifications");
builder.Services.ConfigureAndValidate<UserNotificationsOptions>(config, "notifications");

services.AddMessaging(new ChannelName(options.ChannelName), true);
builder.AddChannel(new ChannelName(options.ChannelName), true);

services.Configure<MessagingOptions>(messaging =>
builder.Configure(messaging =>
{
messaging.Routing.Add(x => x is ConfirmMessage, options.ChannelName);
});

services.AddSingletonAs<UserNotificationStore>()
builder.Services.AddSingletonAs<UserNotificationStore>()
.As<IUserNotificationStore>();

services.AddSingletonAs<UserNotificationFactory>()
builder.Services.AddSingletonAs<UserNotificationFactory>()
.As<IUserNotificationFactory>();

services.AddSingletonAs<UserNotificationService>()
builder.Services.AddSingletonAs<UserNotificationService>()
.As<IUserNotificationService>().AsSelf().As<IScheduleHandler<UserEventMessage>>().As<IMessageHandler>();

services.AddScheduler<UserEventMessage>("UserNotifications");
builder.Services.AddScheduler<UserEventMessage>("UserNotifications");

return builder;
}

public static void AddMyMongoUserNotifications(this IServiceCollection services)
Expand Down
28 changes: 14 additions & 14 deletions backend/src/Notifo.Infrastructure/Notifo.Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.2.0" />
<PackageReference Include="OpenTelemetry" Version="1.7.0" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Squidex.Assets" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.Azure" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.FTP" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.GoogleCloud" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.ImageMagick" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.ImageSharp" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.Mongo" Version="6.5.1" />
<PackageReference Include="Squidex.Assets.S3" Version="6.5.1" />
<PackageReference Include="Squidex.Caching" Version="6.5.1" />
<PackageReference Include="Squidex.Hosting" Version="6.5.1" />
<PackageReference Include="Squidex.Hosting.Abstractions" Version="6.5.1" />
<PackageReference Include="Squidex.Log" Version="6.5.1" />
<PackageReference Include="Squidex.Messaging" Version="6.5.1" />
<PackageReference Include="Squidex.Text" Version="6.5.1" />
<PackageReference Include="Squidex.Assets" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.Azure" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.FTP" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.GoogleCloud" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.ImageMagick" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.ImageSharp" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.Mongo" Version="6.6.2" />
<PackageReference Include="Squidex.Assets.S3" Version="6.6.2" />
<PackageReference Include="Squidex.Caching" Version="6.6.2" />
<PackageReference Include="Squidex.Hosting" Version="6.6.2" />
<PackageReference Include="Squidex.Hosting.Abstractions" Version="6.6.2" />
<PackageReference Include="Squidex.Log" Version="6.6.2" />
<PackageReference Include="Squidex.Messaging" Version="6.6.2" />
<PackageReference Include="Squidex.Text" Version="6.6.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions backend/src/Notifo/Notifo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
<PackageReference Include="Namotion.Reflection" Version="3.1.1" />
<PackageReference Include="NSwag.AspNetCore" Version="14.0.3" />
<PackageReference Include="NSwag.AspNetCore" Version="14.0.4" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.1" />
<PackageReference Include="RefactoringEssentials" Version="5.6.0" PrivateAssets="all" />
<PackageReference Include="Squidex.Messaging.All" Version="6.5.1" />
<PackageReference Include="Squidex.Messaging.All" Version="6.6.2" />
<PackageReference Include="Squidex.OpenTelemetry.Exporter.Stackdriver" Version="0.0.0-alpha.0.97" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
Expand Down
35 changes: 22 additions & 13 deletions backend/src/Notifo/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ public static void AddMyStorage(this IServiceCollection services, IConfiguration
});
}

public static void AddMyMessaging(this IServiceCollection services, IConfiguration config)
{
services.AddMessaging()
.AddTransport(config)
.AddMyUserEvents(config)
.AddMyUserNotifications(config);
}

public static void AddMyClustering(this IServiceCollection services, IConfiguration config, SignalROptions signalROptions)
{
config.ConfigureByOption("clustering:type", new Alternatives
Expand All @@ -79,22 +87,23 @@ public static void AddMyClustering(this IServiceCollection services, IConfigurat
});
}
services.AddRedisTransport(config, options =>
{
options.ConnectionFactory = connection.ConnectAsync;
});
services.AddReplicatedCacheMessaging(true, options =>
{
options.TransportSelector = (transports, name) => transports.First(x => x is RedisTransport);
});
services.AddMessaging()
.AddRedisTransport(config, options =>
{
options.ConnectionFactory = connection.ConnectAsync;
})
.AddReplicatedCache(true, options =>
{
options.TransportSelector = (transports, name) => transports.First(x => x is RedisTransport);
});
},
["None"] = () =>
{
services.AddReplicatedCacheMessaging(false, options =>
{
options.TransportSelector = (transports, name) => transports.First(x => x is NullTransport);
});
services.AddMessaging()
.AddReplicatedCache(false, options =>
{
options.TransportSelector = (transports, name) => transports.First(x => x is NullTransport);
});
}
});
}
Expand Down
4 changes: 1 addition & 3 deletions backend/src/Notifo/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddMyJson(ConfigureJson);
services.AddMyLog();
services.AddMyMedia();
services.AddMessagingTransport(config);
services.AddMyMessaging(config);
services.AddMyMessagingChannel();
services.AddMyMobilePushChannel();
services.AddMyNodaTime();
Expand All @@ -138,8 +138,6 @@ public void ConfigureServices(IServiceCollection services)
services.AddMyTelemetry(config);
services.AddMyTemplates();
services.AddMyTopics();
services.AddMyUserEvents(config);
services.AddMyUserNotifications(config);
services.AddMyUsers();
services.AddMyUtils();
services.AddMyWebChannel();
Expand Down

0 comments on commit 9dce26a

Please sign in to comment.