Open Closed

Question about DistributedEvent #9331


User avatar
0
maharatha@gmail.com created

I am using the Microservice Template to build. And I am using the latest version.

Issue #1 : When I try to publish a a Distributed Event from a Domain Sevice

 public class DocumentEventPublisher : DomainService
private readonly IDistributedEventBus _eventBus;
  public DocumentEventPublisher(IDistributedEventBus eventBus)
  {
      _eventBus = eventBus;
  }

  public async Task PublishSucceededAsync(AnalyzeOperationSucceededEventEto input)
  {
      await _eventBus.PublishAsync(input);
  }

The event doesn't publish meaning I try to log using DistributedEventSentHandler and I don't get a hit. However I could see an entry in Outbox table

But if I use a background job and try to publish it works fine.

What are the things I should look for to be able to publish without the need of a background job.

Issue #2 : I am unable to listen to the even from a different microservice. I did everything that was required , e.g. I create a similar Eto in the mciroservice and made sure the event name is correc. Something like the below :

public class DocumentAnalyzedEventHandler : IDistributedEventHandler<AnalyzeOperationSucceededEventEto>,ITransientDependency

I didn't want to write the whole code but i hope this should be enough to help you understand my issue


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the Microservice Template project source code?

    I will check your DistributedEvent code.

    Thanks.

    liming.ma@volosoft.com

  • User Avatar
    0
    maharatha@gmail.com created

    I have sent out an email , i was able to resolve the issue of publishing events, the only issue is now the other microservice is unable to listen to the event. Everything checks out fine with RabbitMQ in term sof connection and configuration.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Thanks, I will check it asap.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi

    It seems you are using the wrong event ETO.

  • User Avatar
    0
    maharatha@gmail.com created

    Thank You for finding this out.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37