Eshoponcontainers: RabbitMQ IntegrationEvent handler is null

Created on 9 Dec 2019  路  4Comments  路  Source: dotnet-architecture/eShopOnContainers

I am using eShopOnContainers as an example on how to establish a communication between the microservices of my application via RabbitMQ.

My services are able to subscribe and publish events. However, when a service publishes an event, the Handle method of the *IntegrationEventHandler (e.g., this method) is not called. I traced the code back to the following method of the EventBusRabbitMQ where handler is always null in the line 284 below:

https://github.com/dotnet-architecture/eShopOnContainers/blob/8cc680847a4005ca41b26f537b68500f7d2738f9/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs#L261-L299

Any suggestions on what I might be possibly missing?
(I am glad to share any of part my code to help debug this; but since it is a big code, I will share suspected parts upon request.)

Most helpful comment

Hi @nxtx,

Well, that's something not related to eShopOnContainers, but it seems to be a dependency registration issue.

For example, in the case of Ordering.API, the registration of the handlers with AutoFac, occurs here:

https://github.com/dotnet-architecture/eShopOnContainers/blob/8cc680847a4005ca41b26f537b68500f7d2738f9/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs#L45-L46

The above code registers all classes that are specific implementations of IIntegrationEventHandler<TEvent>.

Hope this helps.

All 4 comments

Hi @nxtx,

Well, that's something not related to eShopOnContainers, but it seems to be a dependency registration issue.

For example, in the case of Ordering.API, the registration of the handlers with AutoFac, occurs here:

https://github.com/dotnet-architecture/eShopOnContainers/blob/8cc680847a4005ca41b26f537b68500f7d2738f9/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs#L45-L46

The above code registers all classes that are specific implementations of IIntegrationEventHandler<TEvent>.

Hope this helps.

Closing this issue as not related to eShopOnContainers, but feel free to comment, will reopen if needed.

@mvelosop thanks a bunch! that is exactly what I was missing!

Glad to know that helped you 馃槉

Was this page helpful?
0 / 5 - 0 ratings