Activités de "DominaTang"

After reading this document page, https://docs.abp.io/en/abp/latest/Distributed-Event-Bus I am confused about shall I add distributed lock for event handler. Scenario: The event hander is within a Micro Service and Deployed with two instances. Shall I add distributed lock in event handler so that to make sure one message only processed once? Like code below:

 public async Task HandleEventAsync(EntityDataSyncEto eto)
        {
            try
            {
                await using var handle = await _distributedLock.TryAcquireAsync("SyncEntityList");
                if (handle != null)
                {
                    _ = await _dataSyncAppService.ProcessEntity(eto);
                }
            }
            catch (Exception ex)
            {
                _logger.LogException(ex);
            }
        }

Then I noticed with above lock, if there are several messages coming almost at the same time, some messages are missed to process in the event handler. Thanks, Domina

  • ABP Framework version: v7.2.3
  • UI Type: Angular
  • Database System: EF Core/ MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes , Microservice

Hi,

I don't recommend you do this, I think this may be a usage issue.

If you are willing to provide detailed steps or projects I will try to help you.

Don't have time to prepare sample project code. I get rid of MongoDb side JobLog entity and related code only keep one Micro Service has JobLog entity. Then the duplicate log is gone.

I have another question, when an event bus - event handler subscribe to an event, if the handler code has exception, the message is kept in the queue and keep sending to handler again and again? Is there a setting to set up the max try times or if handler failed, don't keep the message in the queue. (RabbitMQ distributed event bus) (

Hi,

Could you provide the full steps or share a project to reproduce the problem? I will check it. my email is shiwei.liang@volosoft.com

How about disable Abp's auto route binding for a MicroService?

I tried the settings below, none of them works.

Configure<AbpDistributedEntityEventOptions>(options =>
{
   
    options.AutoEventSelectors.Clear();
   options.AutoEventSelectors.RemovelAll(x=>true);
  options.AutoEventSelectors.Remove<JobLog>();
}

I have two MicroSerives, both has an Entity Called "JobLog", and I defined a shared Eto called "JobLogEto". Then both MicroSerivces binds to this JobLogEto from RabbitMQ's exchange binding info. Within one Micro Service, there is a code subscribe to this JobLogEto, and then I noticed there are duplicate records generated, if I manually unbind the second Micro Service to this eto, then no duplicate records insert. Even in second Micro Service, I didn't subscribe to this Eto. The event are triggered twice.

  • ABP Framework version: v7.2.1 + Micro Service

I see some AppService has [IntegrationService] above the AppService. With this annotation, does it mean this AppService are only available called by other Micro Service and Angular UI code can not call this App Service?

  • ABP Framework version: v7.2.1 + MicroService

Thanks. So our controller code should be fine. Need to investigate why the second call failed, the code was working without problem before.

If a Micro Service has two controller, which implement separate AppService, For the [Area("...")], can these two controller use same value? There is a strange behavior right now, when call another MicroService method, the first time call it is fine, and second call failed complain that the remote service is not defined in RemoteService section? Any clue? "Remote service 'xxxxService' was not found and there is no default configuration.

  • ABP Framework version: V7.2.3
  • UI Type: Angular
  • Database System: EF Core / MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi

If several messages published to the event bus in a short period, would the event handling process all the messages without loosing any message when doesn't use the Outbox? Please read more about RabbitMQ Reliability https://www.rabbitmq.com/reliability.html

Hi All the API instances will listen to those message but they have to be configure on the same channel https://github.com/abpframework/abp-samples/tree/master/RabbitMqEventBus You can try this easy sample

you can read https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#outbox-inbox-for-transactional-events more about When should use outbox when shouldn't use outbox?

For item2 I means this page: https://docs.abp.io/en/abp/latest/Distributed-Event-Bus Pre-requirements The outbox/inbox system uses the distributed lock system to handle concurrency when you run multiple instances of your application/service. So, you should configure the distributed lock system with one of the providers as explained in this document. The outbox/inbox system supports Entity Framework Core (EF Core) and MongoDB database providers out of the box. So, your applications should use one of these database providers. For other database providers, see the Implementing a Custom Database Provider section.

We do have Multiple instances of microservices, what does configure 'distributed lock system' means?

  • ABP Framework version: v7.2.1
  • UI Type: Angular
  • Database System: EF Core / MongoDB
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

With Micro-Service architecture which the distributed event bus is implemented by RabbitMQ. I have the following questions:

  1. If several messages published to the event bus in a short period, would the event handling process all the messages without loosing any message when doesn't use the Outbox?
  2. When backend APIs are deployed as several instances, and a message is published to the event bus, all the API instances pickup the same message or only one of the API instance will pick up the message.
  3. When should use outbox when shouldn't use outbox?
Répondre

hi

https://docs.abp.io/en/abp/latest/Unit-Of-Work#conventions

Finally figure out the reason, after deploy the code to Azure kubernetes, NgInx has two settings default to 60 seconds, need to change the value there https://ubiq.co/tech-blog/increase-request-timeout-nginx/

Thanks, Domina

Affichage de 31 à 40 sur 62 entrées
Made with ❤️ on ABP v8.2.0-preview Updated on mars 25, 2024, 15:11