Skip to content

Commit

Permalink
remove ASB preview
Browse files Browse the repository at this point in the history
  • Loading branch information
rickdotnet committed Nov 14, 2024
1 parent 2d02861 commit 85454e2
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 586 deletions.
1 change: 0 additions & 1 deletion demo/ConsoleDemo/ConsoleDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Apollo.Providers.ASB\Apollo.Providers.ASB.csproj" />
<ProjectReference Include="..\..\src\Apollo.Providers.NATS\Apollo.Providers.NATS.csproj" />
</ItemGroup>

Expand Down
76 changes: 0 additions & 76 deletions demo/ConsoleDemo/Demo/AsbDemo.cs

This file was deleted.

2 changes: 1 addition & 1 deletion docs/content/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Overview

Apollo is a flexible library originally designed for NATS that has since evolved to support a generic in-memory provider and an in-preview provider for Azure Service Bus (ASB). At its core, Apollo simplifies communication between different parts of your system by offering a plug-and-play mechanism for routing messages dynamically between local and remote endpoints.
Apollo is a flexible library designed for NATS, with support for a generic in-memory provider. To extend Apollo, developers can implement their own custom providers.

### Key Concepts and Components

Expand Down
2 changes: 1 addition & 1 deletion docs/content/introduction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Introduction

Welcome to the Apollo documentation! Apollo is designed for easy integration with various messaging providers. Whether you need in-memory messaging for simplicity, the robust messaging features of NATS, or the enterprise capabilities of Azure Service Bus, Apollo has you covered.
Welcome to the Apollo documentation! Apollo is designed for easy integration with various messaging providers, including in-memory messaging for simplicity or the robust features of NATS. You can also implement your own custom messaging provider for other use cases.
42 changes: 40 additions & 2 deletions src/Apollo.Extensions.Microsoft.Hosting/ApolloBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ public interface IApolloBuilder
IApolloBuilder WithDefaultConsumerName(string consumerName);
IApolloBuilder WithDefaultNamespace(string defaultNamespace);
IApolloBuilder CreateMissingResources(bool createMissingResources = true);
IApolloBuilder WithAckStrategy(AckStrategy ackStrategy);
IApolloBuilder PublishOnly(bool publishOnly = true);
IApolloBuilder AddEndpoint<TEndpoint>(EndpointConfig config) where TEndpoint : class;
IApolloBuilder AddHandler(EndpointConfig config, Func<ApolloContext, CancellationToken, Task> handler);
IApolloBuilder WithEndpointProvider(IEndpointProvider endpointProvider);
IApolloBuilder WithEndpointProvider<TProvider>() where TProvider : class, IEndpointProvider;
IApolloBuilder WithSubscriberProvider(ISubscriptionProvider subscriberProvider);
IApolloBuilder WithSubscriberProvider<TProvider>() where TProvider : class, ISubscriptionProvider;
IApolloBuilder WithProviderPublisher(IProviderPublisher providerPublisher);
IApolloBuilder WithProviderPublisher<TPublisher>() where TPublisher : class, IProviderPublisher;
}

internal class ApolloBuilder : IApolloBuilder
{
public IServiceCollection Services { get; }
private ApolloConfig config = new();

public ApolloBuilder(IServiceCollection services)
{
Services = services;
Expand Down Expand Up @@ -75,6 +80,12 @@ public IApolloBuilder CreateMissingResources(bool createMissingResources = true)
return this;
}

public IApolloBuilder WithAckStrategy(AckStrategy ackStrategy)
{
config.AckStrategy = ackStrategy;
return this;
}

/// <summary>
/// Set the service to publish only mode
/// </summary>
Expand Down Expand Up @@ -120,7 +131,34 @@ public IApolloBuilder WithEndpointProvider(IEndpointProvider endpointProvider)
/// <returns></returns>
public IApolloBuilder WithEndpointProvider<TProvider>() where TProvider : class, IEndpointProvider
{
Services.TryAddSingleton<IEndpointProvider, TProvider>();
Services.TryAddSingleton<TProvider>();
Services.TryAddSingleton<IEndpointProvider>(serviceProvider => serviceProvider.GetRequiredService<TProvider>());
return this;
}

public IApolloBuilder WithSubscriberProvider(ISubscriptionProvider subscriberProvider)
{
Services.TryAddSingleton<ISubscriptionProvider>(subscriberProvider);
return this;
}

public IApolloBuilder WithSubscriberProvider<TProvider>() where TProvider : class, ISubscriptionProvider
{
Services.TryAddSingleton<TProvider>();
Services.TryAddSingleton<ISubscriptionProvider>(serviceProvider => serviceProvider.GetRequiredService<TProvider>());
return this;
}

public IApolloBuilder WithProviderPublisher(IProviderPublisher providerPublisher)
{
Services.TryAddSingleton<IProviderPublisher>(providerPublisher);
return this;
}

public IApolloBuilder WithProviderPublisher<TPublisher>() where TPublisher : class, IProviderPublisher
{
Services.TryAddSingleton<TPublisher>();
Services.TryAddSingleton<IProviderPublisher>(serviceProvider => serviceProvider.GetRequiredService<TPublisher>());
return this;
}

Expand Down
23 changes: 0 additions & 23 deletions src/Apollo.Providers.ASB/Apollo.Providers.ASB.csproj

This file was deleted.

15 changes: 0 additions & 15 deletions src/Apollo.Providers.ASB/AsbConfig.cs

This file was deleted.

21 changes: 0 additions & 21 deletions src/Apollo.Providers.ASB/AsbPublisher.cs

This file was deleted.

40 changes: 0 additions & 40 deletions src/Apollo.Providers.ASB/AsbSubscriptionProvider.cs

This file was deleted.

Loading

0 comments on commit 85454e2

Please sign in to comment.