commit
						a0f7dba7cb
					
				@ -12,6 +12,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								src/BuildingBlocks/EventBus/EventBus/Utils.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/BuildingBlocks/EventBus/EventBus/Utils.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
 | 
			
		||||
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
 | 
			
		||||
 | 
			
		||||
public static class Utils
 | 
			
		||||
{
 | 
			
		||||
    public static string CalculateMd5Hash(string input)
 | 
			
		||||
    {
 | 
			
		||||
        using var md5 = System.Security.Cryptography.MD5.Create();
 | 
			
		||||
        var inputBytes = Encoding.ASCII.GetBytes(input);
 | 
			
		||||
        var hashBytes = md5.ComputeHash(inputBytes);
 | 
			
		||||
        return Convert.ToHexString(hashBytes);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,35 @@
 | 
			
		||||
using Microsoft.Extensions.Configuration;
 | 
			
		||||
 | 
			
		||||
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusKafka;
 | 
			
		||||
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// Class for making sure we do not open new producer context (expensive)
 | 
			
		||||
/// everytime a service publishes an event.
 | 
			
		||||
/// On startup each service creates an singleton instance of this class,
 | 
			
		||||
/// which is then used when publishing any events.
 | 
			
		||||
///
 | 
			
		||||
/// based on https://github.com/confluentinc/confluent-kafka-dotnet/blob/master/examples/Web/KafkaClientHandle.cs
 | 
			
		||||
///  
 | 
			
		||||
/// </summary>
 | 
			
		||||
public class DefaultKafkaPersistentConnection
 | 
			
		||||
    : IKafkaPersistentConnection
 | 
			
		||||
{
 | 
			
		||||
    private readonly IProducer<byte[], byte[]> _kafkaProducer;
 | 
			
		||||
 | 
			
		||||
    public DefaultKafkaPersistentConnection(IConfiguration configuration)
 | 
			
		||||
    {
 | 
			
		||||
        var producerConfig = new ProducerConfig();
 | 
			
		||||
        configuration.GetSection("Kafka:ProducerSettings").Bind(producerConfig);
 | 
			
		||||
        _kafkaProducer = new ProducerBuilder<byte[], byte[]>(producerConfig).Build();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Handle Handle => _kafkaProducer.Handle;
 | 
			
		||||
 | 
			
		||||
    public void Dispose()
 | 
			
		||||
    {
 | 
			
		||||
        // Block until all outstanding produce requests have completed (with or
 | 
			
		||||
        // without error).
 | 
			
		||||
        _kafkaProducer.Flush();
 | 
			
		||||
        _kafkaProducer.Dispose();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								src/BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								src/BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,76 @@
 | 
			
		||||
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusKafka;
 | 
			
		||||
 | 
			
		||||
public class EventBusKafka : IEventBus, IDisposable
 | 
			
		||||
{
 | 
			
		||||
    // for now use single topic and event names as keys for messages
 | 
			
		||||
    // such that they always land in same partition and we have ordering guarantee
 | 
			
		||||
    // then the consumers have to ignore events they are not subscribed to
 | 
			
		||||
    // alternatively could have multiple topics (associated with event name)
 | 
			
		||||
    private const string TopicName = "eshop_event_bus";
 | 
			
		||||
 | 
			
		||||
    private readonly IKafkaPersistentConnection _persistentConnection;
 | 
			
		||||
    private readonly ILogger<EventBusKafka> _logger;
 | 
			
		||||
    private readonly IEventBusSubscriptionsManager _subsManager;
 | 
			
		||||
    private const string IntegrationEventSuffix = "IntegrationEvent";
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    // Object that will be registered as singleton to each service on startup,
 | 
			
		||||
    // which will be used to publish and subscribe to events.
 | 
			
		||||
    public EventBusKafka(IKafkaPersistentConnection persistentConnection,
 | 
			
		||||
        ILogger<EventBusKafka> logger, IEventBusSubscriptionsManager subsManager)
 | 
			
		||||
    {
 | 
			
		||||
        _persistentConnection = persistentConnection ?? throw new ArgumentNullException(nameof(persistentConnection));
 | 
			
		||||
        _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 | 
			
		||||
        _subsManager = subsManager;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public void Publish(IntegrationEvent @event)
 | 
			
		||||
    {
 | 
			
		||||
        var eventName = @event.GetType().Name.Replace(IntegrationEventSuffix, "");
 | 
			
		||||
        var jsonMessage = JsonSerializer.Serialize(@event, @event.GetType());
 | 
			
		||||
        
 | 
			
		||||
        // map Integration event to kafka message
 | 
			
		||||
        // event name something like OrderPaymentSucceededIntegrationEvent
 | 
			
		||||
        var message = new Message<string, string> { Key = eventName, Value = jsonMessage };
 | 
			
		||||
        var kafkaHandle = 
 | 
			
		||||
            new DependentProducerBuilder<string, string>(_persistentConnection.Handle).Build();
 | 
			
		||||
        
 | 
			
		||||
        Console.WriteLine($"Publishing event: {eventName}\n Content: {Utils.CalculateMd5Hash(jsonMessage)}");
 | 
			
		||||
        
 | 
			
		||||
        kafkaHandle.ProduceAsync(TopicName, message);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void Subscribe<T, TH>() where T : IntegrationEvent where TH : IIntegrationEventHandler<T>
 | 
			
		||||
    {
 | 
			
		||||
        var eventName = _subsManager.GetEventKey<T>();
 | 
			
		||||
        // DoInternalSubscription(eventName);
 | 
			
		||||
 | 
			
		||||
        _logger.LogInformation("Subscribing to event {EventName} with {EventHandler}", eventName, typeof(TH).GetGenericTypeName());
 | 
			
		||||
 | 
			
		||||
        _subsManager.AddSubscription<T, TH>();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void SubscribeDynamic<TH>(string eventName) where TH : IDynamicIntegrationEventHandler
 | 
			
		||||
    {
 | 
			
		||||
        throw new NotImplementedException();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Taken directly from rabbitMQ implementation
 | 
			
		||||
    public void UnsubscribeDynamic<TH>(string eventName) where TH : IDynamicIntegrationEventHandler
 | 
			
		||||
    {
 | 
			
		||||
        _subsManager.RemoveDynamicSubscription<TH>(eventName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Taken directly from rabbitMQ implementation
 | 
			
		||||
    public void Unsubscribe<T, TH>() where T : IntegrationEvent where TH : IIntegrationEventHandler<T>
 | 
			
		||||
    {
 | 
			
		||||
        var eventName = _subsManager.GetEventKey<T>();
 | 
			
		||||
        _logger.LogInformation("Unsubscribing from event {EventName}", eventName);
 | 
			
		||||
        _subsManager.RemoveSubscription<T, TH>();        
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void Dispose()
 | 
			
		||||
    {
 | 
			
		||||
        _subsManager.Clear();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,26 @@
 | 
			
		||||
<Project Sdk="Microsoft.NET.Sdk">
 | 
			
		||||
 | 
			
		||||
    <PropertyGroup>
 | 
			
		||||
        <TargetFramework>net7.0</TargetFramework>
 | 
			
		||||
        <ImplicitUsings>enable</ImplicitUsings>
 | 
			
		||||
        <Nullable>enable</Nullable>
 | 
			
		||||
    </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
      <ProjectReference Include="..\EventBus\EventBus.csproj" />
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
      <PackageReference Include="Autofac" Version="6.5.0" />
 | 
			
		||||
      <PackageReference Include="Confluent.Kafka" Version="2.0.2" />
 | 
			
		||||
      <PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
 | 
			
		||||
      <PackageReference Include="Polly" Version="7.2.3" />
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
 | 
			
		||||
    <ItemGroup>
 | 
			
		||||
      <Reference Include="Microsoft.Extensions.Logging.Abstractions">
 | 
			
		||||
        <HintPath>..\..\..\..\..\..\.nuget\packages\microsoft.extensions.logging.abstractions\7.0.0\lib\net7.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
 | 
			
		||||
      </Reference>
 | 
			
		||||
    </ItemGroup>
 | 
			
		||||
 | 
			
		||||
</Project>
 | 
			
		||||
							
								
								
									
										14
									
								
								src/BuildingBlocks/EventBus/EventBusKafka/GlobalUsings.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/BuildingBlocks/EventBus/EventBusKafka/GlobalUsings.cs
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
global using Polly;
 | 
			
		||||
global using Polly.Retry;
 | 
			
		||||
global using System;
 | 
			
		||||
global using System.IO;
 | 
			
		||||
global using System.Net.Sockets;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
 | 
			
		||||
global using Microsoft.Extensions.Logging;
 | 
			
		||||
global using Confluent.Kafka;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions;
 | 
			
		||||
global using System.Text;
 | 
			
		||||
global using System.Threading.Tasks;
 | 
			
		||||
global using System.Text.Json;
 | 
			
		||||
@ -0,0 +1,7 @@
 | 
			
		||||
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusKafka;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
public interface IKafkaPersistentConnection : IDisposable
 | 
			
		||||
{
 | 
			
		||||
    Handle Handle { get; }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,120 @@
 | 
			
		||||
using System.Security.Cryptography;
 | 
			
		||||
using Autofac;
 | 
			
		||||
using Microsoft.Extensions.Configuration;
 | 
			
		||||
using Microsoft.Extensions.Hosting;
 | 
			
		||||
 | 
			
		||||
namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusKafka;
 | 
			
		||||
 | 
			
		||||
/* Inspired by https://github.com/confluentinc/confluent-kafka-dotnet/blob/master/examples/Web/RequestTimeConsumer.cs */
 | 
			
		||||
public class KafkaConsumerBackgroundService : BackgroundService
 | 
			
		||||
{
 | 
			
		||||
    private readonly IEventBusSubscriptionsManager _subsManager;
 | 
			
		||||
    private readonly ILifetimeScope _autofac;
 | 
			
		||||
    private readonly ILogger<KafkaConsumerBackgroundService> _logger;
 | 
			
		||||
    private readonly IConsumer<string, string> _kafkaConsumer;
 | 
			
		||||
    private const string AutofacScopeName = "eshop_event_bus";
 | 
			
		||||
    private const string TopicName = "eshop_event_bus";
 | 
			
		||||
 | 
			
		||||
    public KafkaConsumerBackgroundService(IConfiguration configuration, 
 | 
			
		||||
        IEventBusSubscriptionsManager subsManager, 
 | 
			
		||||
        ILifetimeScope autofac,
 | 
			
		||||
        ILogger<KafkaConsumerBackgroundService> logger) 
 | 
			
		||||
    {
 | 
			
		||||
        var consumerConfig = new ConsumerConfig();
 | 
			
		||||
        configuration.GetSection("Kafka:ConsumerSettings").Bind(consumerConfig);
 | 
			
		||||
        _kafkaConsumer = new ConsumerBuilder<string, string>(consumerConfig).Build();
 | 
			
		||||
        
 | 
			
		||||
        _subsManager = subsManager;
 | 
			
		||||
        _autofac = autofac;
 | 
			
		||||
        _logger = logger;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    protected override Task ExecuteAsync(CancellationToken stoppingToken)
 | 
			
		||||
    {
 | 
			
		||||
        return Task.Run(() => StartConsumerLoop(stoppingToken), stoppingToken);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private async Task StartConsumerLoop(CancellationToken cancellationToken)
 | 
			
		||||
    {
 | 
			
		||||
        _kafkaConsumer.Subscribe(TopicName);
 | 
			
		||||
 | 
			
		||||
        while (!cancellationToken.IsCancellationRequested)
 | 
			
		||||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                var consumeResult = _kafkaConsumer.Consume(cancellationToken);
 | 
			
		||||
 | 
			
		||||
                var eventName = consumeResult.Message.Key;
 | 
			
		||||
                var messageContent = consumeResult.Message.Value;
 | 
			
		||||
                
 | 
			
		||||
                Console.WriteLine($"Consumed event: {eventName}\n Content: {Utils.CalculateMd5Hash(messageContent)}");
 | 
			
		||||
 | 
			
		||||
                if (!_subsManager.HasSubscriptionsForEvent(eventName))
 | 
			
		||||
                {
 | 
			
		||||
                    _logger.LogWarning("No subscription for Kafka event: {EventName}", eventName);
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
                
 | 
			
		||||
                await using var scope = _autofac.BeginLifetimeScope(AutofacScopeName);
 | 
			
		||||
                var subscriptions = _subsManager.GetHandlersForEvent(eventName);
 | 
			
		||||
                foreach (var subscription in subscriptions)
 | 
			
		||||
                {
 | 
			
		||||
                    #region dynamic subscription
 | 
			
		||||
                    /* We do not support dynamic subscription at the moment*/
 | 
			
		||||
                    // if (subscription.IsDynamic)
 | 
			
		||||
                    // {
 | 
			
		||||
                    //     if (scope.ResolveOptional(subscription.HandlerType) is not IDynamicIntegrationEventHandler handler) continue;
 | 
			
		||||
                    //     using dynamic eventData = JsonDocument.Parse(message);
 | 
			
		||||
                    //     await Task.Yield();
 | 
			
		||||
                    //     await handler.Handle(eventData);
 | 
			
		||||
                    // }
 | 
			
		||||
                    #endregion
 | 
			
		||||
                    
 | 
			
		||||
                    /* The code below applies to non-dynamic subscriptions only */
 | 
			
		||||
                    var handler = scope.ResolveOptional(subscription.HandlerType);
 | 
			
		||||
                    if (handler == null) continue;
 | 
			
		||||
                    var eventType = _subsManager.GetEventTypeByName(eventName);
 | 
			
		||||
                    var integrationEvent = JsonSerializer.Deserialize(messageContent, 
 | 
			
		||||
                        eventType, 
 | 
			
		||||
                        new JsonSerializerOptions
 | 
			
		||||
                        {
 | 
			
		||||
                            PropertyNameCaseInsensitive = true
 | 
			
		||||
                        });
 | 
			
		||||
                    var concreteType = typeof(IIntegrationEventHandler<>).MakeGenericType(eventType);
 | 
			
		||||
 | 
			
		||||
                    await Task.Yield();
 | 
			
		||||
                    await (Task)concreteType.GetMethod("Handle")
 | 
			
		||||
                        .Invoke(handler, new object[] { integrationEvent });
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            catch (OperationCanceledException)
 | 
			
		||||
            {
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
            catch (ConsumeException e)
 | 
			
		||||
            {
 | 
			
		||||
                // Consumer errors should generally be ignored (or logged) unless fatal.
 | 
			
		||||
                Console.WriteLine($"Consume error: {e.Error.Reason}");
 | 
			
		||||
 | 
			
		||||
                if (e.Error.IsFatal)
 | 
			
		||||
                {
 | 
			
		||||
                    // https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md#fatal-consumer-errors
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception e)
 | 
			
		||||
            {
 | 
			
		||||
                Console.WriteLine($"Unexpected error: {e}");
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
        
 | 
			
		||||
    public override void Dispose()
 | 
			
		||||
    {
 | 
			
		||||
        _kafkaConsumer.Close(); // Commit offsets and leave the group cleanly.
 | 
			
		||||
        _kafkaConsumer.Dispose();
 | 
			
		||||
 | 
			
		||||
        base.Dispose();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@ -54,6 +54,7 @@
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusKafka\EventBusKafka.csproj" />
 | 
			
		||||
    <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
 | 
			
		||||
    <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
 | 
			
		||||
    <ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,7 @@ COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
 | 
			
		||||
COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj"
 | 
			
		||||
COPY "Services/Basket/Basket.API/Basket.API.csproj" "Services/Basket/Basket.API/Basket.API.csproj"
 | 
			
		||||
 | 
			
		||||
@ -8,6 +8,7 @@ WORKDIR /src
 | 
			
		||||
 | 
			
		||||
COPY ["BuildingBlocks/EventBus/EventBus/EventBus.csproj", "BuildingBlocks/EventBus/EventBus/"]
 | 
			
		||||
COPY ["BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "BuildingBlocks/EventBus/EventBusRabbitMQ/"]
 | 
			
		||||
COPY ["BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EvenBusKafka/"]
 | 
			
		||||
COPY ["BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "BuildingBlocks/EventBus/EventBusServiceBus/"]
 | 
			
		||||
COPY ["Services/Basket/Basket.API/Basket.API.csproj", "Services/Basket/Basket.API/"]
 | 
			
		||||
COPY ["NuGet.config", "NuGet.config"]
 | 
			
		||||
 | 
			
		||||
@ -28,6 +28,7 @@ global using Azure.Messaging.ServiceBus;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusKafka;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
 | 
			
		||||
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus;
 | 
			
		||||
global using Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,3 @@
 | 
			
		||||
using Microsoft.AspNetCore.Authentication.Cookies;
 | 
			
		||||
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
 | 
			
		||||
 | 
			
		||||
namespace Microsoft.eShopOnContainers.Services.Basket.API;
 | 
			
		||||
public class Startup
 | 
			
		||||
{
 | 
			
		||||
@ -90,6 +87,10 @@ public class Startup
 | 
			
		||||
                return new DefaultServiceBusPersisterConnection(serviceBusConnectionString);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        else if (Configuration.GetValue<bool>("KafkaEnabled"))
 | 
			
		||||
        {
 | 
			
		||||
            services.AddSingleton<IKafkaPersistentConnection, DefaultKafkaPersistentConnection>();
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            services.AddSingleton<IRabbitMQPersistentConnection>(sp =>
 | 
			
		||||
@ -253,12 +254,17 @@ public class Startup
 | 
			
		||||
                var iLifetimeScope = sp.GetRequiredService<ILifetimeScope>();
 | 
			
		||||
                var logger = sp.GetRequiredService<ILogger<EventBusServiceBus>>();
 | 
			
		||||
                var eventBusSubscriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>();
 | 
			
		||||
                string subscriptionName = Configuration["SubscriptionClientName"];
 | 
			
		||||
                var subscriptionName = Configuration["SubscriptionClientName"];
 | 
			
		||||
 | 
			
		||||
                return new EventBusServiceBus(serviceBusPersisterConnection, logger,
 | 
			
		||||
                    eventBusSubscriptionsManager, iLifetimeScope, subscriptionName);
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
        else if (Configuration.GetValue<bool>("KafkaEnabled"))
 | 
			
		||||
        {
 | 
			
		||||
            services.AddHostedService<KafkaConsumerBackgroundService>();
 | 
			
		||||
            services.AddSingleton<IEventBus, EventBusKafka>();
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            services.AddSingleton<IEventBus, EventBusRabbitMQ>(sp =>
 | 
			
		||||
 | 
			
		||||
@ -13,5 +13,15 @@
 | 
			
		||||
  "IdentityUrl": "http://localhost:5105",
 | 
			
		||||
  "ConnectionString": "127.0.0.1",
 | 
			
		||||
  "AzureServiceBusEnabled": false,
 | 
			
		||||
  "EventBusConnection": "localhost"
 | 
			
		||||
  "EventBusConnection": "localhost",
 | 
			
		||||
  "KafkaEnabled": true,
 | 
			
		||||
  "Kafka": {
 | 
			
		||||
    "ProducerSettings": {
 | 
			
		||||
      "BootstrapServers": "broker:9092"
 | 
			
		||||
    },
 | 
			
		||||
    "ConsumerSettings": {
 | 
			
		||||
      "BootstrapServers": "broker:9092",
 | 
			
		||||
      "GroupId": "basket-group-id"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -26,5 +26,15 @@
 | 
			
		||||
    "Name": "eshop",
 | 
			
		||||
    "ClientId": "your-client-id",
 | 
			
		||||
    "ClientSecret": "your-client-secret"
 | 
			
		||||
  },
 | 
			
		||||
  "KafkaEnabled": true,
 | 
			
		||||
  "Kafka": {
 | 
			
		||||
    "ProducerSettings": {
 | 
			
		||||
      "BootstrapServers": "broker:9092"
 | 
			
		||||
    },
 | 
			
		||||
    "ConsumerSettings": {
 | 
			
		||||
      "BootstrapServers": "broker:9092",
 | 
			
		||||
      "GroupId": "basket-group-id"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,7 @@ COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
 | 
			
		||||
COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj"
 | 
			
		||||
 | 
			
		||||
@ -11,5 +11,14 @@
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "EventBusConnection": "localhost"
 | 
			
		||||
  "EventBusConnection": "localhost",
 | 
			
		||||
  "Kafka": {
 | 
			
		||||
    "ProducerSettings": {
 | 
			
		||||
      "BootstrapServers": "localhost:9092"
 | 
			
		||||
    },
 | 
			
		||||
    "ConsumerSettings": {
 | 
			
		||||
      "BootstrapServers": "localhost:9092",
 | 
			
		||||
      "GroupId": "catalog-group-id"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -12,6 +12,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
@ -13,6 +13,7 @@ COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
 | 
			
		||||
@ -5,5 +5,14 @@
 | 
			
		||||
      "System": "Information",
 | 
			
		||||
      "Microsoft": "Information"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "Kafka": {
 | 
			
		||||
    "ProducerSettings": {
 | 
			
		||||
      "BootstrapServers": "localhost:9092"
 | 
			
		||||
    },
 | 
			
		||||
    "ConsumerSettings": {
 | 
			
		||||
      "BootstrapServers": "localhost:9092",
 | 
			
		||||
      "GroupId": "ordering-group-id"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,7 @@ COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
 | 
			
		||||
 | 
			
		||||
@ -15,6 +15,7 @@ COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
 | 
			
		||||
COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj"
 | 
			
		||||
 | 
			
		||||
@ -6,5 +6,14 @@
 | 
			
		||||
      "System": "Information",
 | 
			
		||||
      "Microsoft": "Information"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "Kafka": {
 | 
			
		||||
    "ProducerSettings": {
 | 
			
		||||
      "BootstrapServers": "localhost:9092"
 | 
			
		||||
    },
 | 
			
		||||
    "ConsumerSettings": {
 | 
			
		||||
      "BootstrapServers": "localhost:9092",
 | 
			
		||||
      "GroupId": "payment-group-id"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -14,6 +14,7 @@ COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
@ -23,6 +23,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
@ -12,6 +12,7 @@ COPY "eShopOnContainers-ServicesAndWebApps.sln" "eShopOnContainers-ServicesAndWe
 | 
			
		||||
COPY "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj" "ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj" "ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj"
 | 
			
		||||
COPY "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj" "BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus/EventBus.csproj" "BuildingBlocks/EventBus/EventBus/EventBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
 | 
			
		||||
@ -18,6 +18,7 @@ COPY "BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj" "BuildingBlo
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj" "BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj" "BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj" "BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj"
 | 
			
		||||
COPY "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj" "BuildingBlocks/EventBus/EventBusKafka/EventBusKafka.csproj"
 | 
			
		||||
COPY "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj" "BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj"
 | 
			
		||||
COPY "Services/Basket/Basket.API/Basket.API.csproj" "Services/Basket/Basket.API/Basket.API.csproj"
 | 
			
		||||
COPY "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj" "Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj"
 | 
			
		||||
 | 
			
		||||
@ -33,11 +33,31 @@ services:
 | 
			
		||||
      - "6379:6379"
 | 
			
		||||
    volumes:
 | 
			
		||||
      - eshop-basketdata:/data
 | 
			
		||||
    
 | 
			
		||||
  rabbitmq:
 | 
			
		||||
    ports:
 | 
			
		||||
      - "15672:15672"
 | 
			
		||||
      - "5672:5672"
 | 
			
		||||
        
 | 
			
		||||
  zookeeper:
 | 
			
		||||
    environment:
 | 
			
		||||
      ZOOKEEPER_CLIENT_PORT: 2181
 | 
			
		||||
      ZOOKEEPER_TICK_TIME: 2000
 | 
			
		||||
 | 
			
		||||
  broker:
 | 
			
		||||
    environment:
 | 
			
		||||
      KAFKA_BROKER_ID: 1
 | 
			
		||||
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
 | 
			
		||||
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
 | 
			
		||||
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:9092,PLAINTEXT_HOST://localhost:29092
 | 
			
		||||
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
 | 
			
		||||
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
 | 
			
		||||
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
 | 
			
		||||
    ports:
 | 
			
		||||
      # To learn about configuring Kafka for access across networks see
 | 
			
		||||
      # https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
 | 
			
		||||
      - "9092:9092"
 | 
			
		||||
      
 | 
			
		||||
  identity-api:
 | 
			
		||||
    environment:
 | 
			
		||||
      - ASPNETCORE_ENVIRONMENT=Development
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,14 @@ services:
 | 
			
		||||
  rabbitmq:
 | 
			
		||||
    image: rabbitmq:3-management-alpine
 | 
			
		||||
    
 | 
			
		||||
  zookeeper:
 | 
			
		||||
    image: confluentinc/cp-zookeeper:7.3.0
 | 
			
		||||
 | 
			
		||||
  broker:
 | 
			
		||||
    image: confluentinc/cp-kafka:7.3.0
 | 
			
		||||
    depends_on:
 | 
			
		||||
      - zookeeper  
 | 
			
		||||
 | 
			
		||||
  identity-api:
 | 
			
		||||
    image: ${REGISTRY:-eshop}/identity.api:${PLATFORM:-linux}-${TAG:-latest}
 | 
			
		||||
    build:
 | 
			
		||||
@ -34,6 +42,7 @@ services:
 | 
			
		||||
      - basketdata
 | 
			
		||||
      - identity-api
 | 
			
		||||
      - rabbitmq
 | 
			
		||||
      - broker
 | 
			
		||||
 | 
			
		||||
  catalog-api:
 | 
			
		||||
    image: ${REGISTRY:-eshop}/catalog.api:${PLATFORM:-linux}-${TAG:-latest}
 | 
			
		||||
 | 
			
		||||
@ -53,6 +53,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBus", "BuildingBlocks\
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventBusRabbitMQ", "BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj", "{8088F3FC-6787-45FA-A924-816EC81CBFAC}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventBusKafka", "BuildingBlocks\EventBus\EventBusKafka\EventBusKafka.csproj", "{230B3FC1-6971-43C4-A75E-867F5F24B607}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationEventLogEF", "BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj", "{9EE28E45-1533-472B-8267-56C48855BA0E}"
 | 
			
		||||
EndProject
 | 
			
		||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebStatus", "Web\WebStatus\WebStatus.csproj", "{C0A7918D-B4F2-4E7F-8DE2-1E5279EF079F}"
 | 
			
		||||
@ -1530,6 +1532,54 @@ Global
 | 
			
		||||
		{95D735BE-2899-4495-BE3F-2600E93B4E3C}.Release|x64.Build.0 = Release|Any CPU
 | 
			
		||||
		{95D735BE-2899-4495-BE3F-2600E93B4E3C}.Release|x86.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{95D735BE-2899-4495-BE3F-2600E93B4E3C}.Release|x86.Build.0 = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|Any CPU.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|ARM.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|ARM.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|iPhone.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|x64.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|x64.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|x86.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.AppStore|x86.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|Any CPU.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|ARM.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|ARM.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|iPhone.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|iPhone.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|x64.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|x64.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|x86.ActiveCfg = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Debug|x86.Build.0 = Debug|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|Any CPU.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|Any CPU.Build.0 = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|ARM.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|ARM.Build.0 = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|iPhone.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|iPhone.Build.0 = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|x64.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|x64.Build.0 = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|x86.ActiveCfg = Release|Any CPU
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607}.Release|x86.Build.0 = Release|Any CPU
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(SolutionProperties) = preSolution
 | 
			
		||||
		HideSolutionNode = FALSE
 | 
			
		||||
@ -1588,6 +1638,7 @@ Global
 | 
			
		||||
		{B62E859F-825E-4C8B-93EC-5966EACFD026} = {798BFC44-2CCD-45FA-B37A-5173B03C2B30}
 | 
			
		||||
		{373D8AA1-36BE-49EC-89F0-6CB736666285} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F}
 | 
			
		||||
		{95D735BE-2899-4495-BE3F-2600E93B4E3C} = {373D8AA1-36BE-49EC-89F0-6CB736666285}
 | 
			
		||||
		{230B3FC1-6971-43C4-A75E-867F5F24B607} = {807BB76E-B2BB-47A2-A57B-3D1B20FF5E7F}
 | 
			
		||||
	EndGlobalSection
 | 
			
		||||
	GlobalSection(ExtensibilityGlobals) = postSolution
 | 
			
		||||
		SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user