Open Closed

Kafka integration for when upgrading 5.3.0 is giving an issue #3341


User avatar
0
tahseelit1 created
  • ABP Framework version: v5.3.0

  • UI type: Angular

  • DB provider: EF Core

  • Identity Server Separated (Angular): yes

  • Exception message and stack trace: Confluent.Kafka.ProduceException`2: 'Local: Erroneous state'

  • at Confluent.Kafka.Producer`2.<ProduceAsync>d__56.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Volo.Abp.EventBus.Kafka.KafkaDistributedEventBus.<PublishAsync>d__36.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Volo.Abp.EventBus.Kafka.KafkaDistributedEventBus.<PublishToEventBusAsync>d__30.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult() at Volo.Abp.EventBus.Distributed.DistributedEventBusBase.<PublishAsync>d__13.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at App2.App2MessagingService.<RunAsync>d__2.MoveNext() in C:\Users\moise\Downloads\abp-samples-master\abp-samples-master\KafkaEventBus\App2\App2MessagingService.cs:line 33 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at App2.Program.<Main>d__0.MoveNext() in C:\Users\moise\Downloads\abp-samples-master\abp-samples-master\KafkaEventBus\App2\Program.cs:line 22

  • Steps to reproduce the issue:"

  • download the latest abp kafka example build in 5.3.0 and run the example.

  • it is working fine in 5.2.2 version.


4 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I will check it out.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    We will fix the problem: https://github.com/abpframework/abp/pull/13158, your ticket has been refunded

    You can try this as a temporary solution:

    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(IProducerPool))]
    public class MyProducerPool : ProducerPool, ISingletonDependency
    {
        public MyProducerPool(IOptions<AbpKafkaOptions> options) : base(options)
        {
        }
    
        public override IProducer<string, byte[]> Get(string connectionName = null)
        {
            connectionName ??= KafkaConnections.DefaultConnectionName;
            
            return Producers.GetOrAdd(
                connectionName, connection => new Lazy<IProducer<string, byte[]>>(() =>
                {
                    var producerConfig = new ProducerConfig(Options.Connections.GetOrDefault(connection));
                    Options.ConfigureProducer?.Invoke(producerConfig);
                    return new ProducerBuilder<string, byte[]>(producerConfig).Build();
                })).Value;
        }
    }
    
  • User Avatar
    0
    tahseelit1 created

    Hi thank you for your quick response.,

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    We will release 5.3.1 version today.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09