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)
-
0
hi
Can you share the
Microservice Template
project source code?I will check your
DistributedEvent
code.Thanks.
liming.ma@volosoft.com
-
0
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.
-
0
Thanks, I will check it asap.
-
0
-
0
Thank You for finding this out.
-
0
: )