After our discussion, modifying the MessageTimeoutMs is not the best option for us because it's difficult to set an appropriate timeout.
We would like to handle the issue of not being able to connect to the Kafka server and do not want the API to block. Currently, we have configured the settings as follows:
Configure<AbpKafkaOptions>(options =>
{
options.ConfigureProducer = config =>
{
config.EnableIdempotence = true;
config.MessageSendMaxRetries = 3;
config.RetryBackoffMs = 1000;
};
});
After the retries are exhausted, we still need to wait for the MessageTimeoutMs time.(default = 300000ms) Is it possible to prioritize the retry time, so that an error is reported when the retries are exhausted?
Test OK.
There is another question: Can I configure ProducerConfig and ConsumerConfig using the appsettings.json file? Or can they only be configured using the Options Classes? https://docs.abp.io/en/abp/latest/Distributed-Event-Bus-Kafka-Integration
Thanks, let me try it.
Hello,
We are using DistributedEventBus with Confluent Kafka.
We have wrapped _distributedEventBus.PublishAsync(event) in a try-catch block, but it doesn't catch the exception when it can't connect to Confluence Kafka. (Following your suggestion, use try-catch in https://support.abp.io/QA/Questions/3079/IDistributedEventBus-throw-exception-when-it-can-not-connect-to-Kafka)
try
{
await _distributedEventBus.PublishAsync(eventData);
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
throw;
}
Additionally, we need to wait for 5 more minutes, then application throw exception as "An internal error occurred during your request!". For the request, it took too much time.
Q1: Why can't we catch the exception? Q2: How to avoid waiting for too long?