Open Closed

How to using Distributed Event Bus for Module Template #5547


User avatar
0
duyenvt created

Our solution are separated to many modules and sometime we need to join or get data from other modules. I'm using Blazor Wasm Module Template from ABP Suite and using EF PostgreSQL. Then will build Modules to Nuget Package and use in Application Template (Separate Authentication Server)

  • For example:

Module A [ Order(OrderID, CustomerID, Total), Tax(TaxID,Desr), ... ] Module B [ Customer(CustomerID, Customer Name), ...]

I am in Module A and I want to retrieve list of Customers from Module B

And in some cases is vice versa, such as I'm in module B and I want to retrieve list of Orders (module A) of a customer in module B.

Could you please give me a sample code or workflow for my case?


1 Answer(s)
  • User Avatar
    0
    jfistelmann created

    Hey,

    Modules do not work in that way. A module in itself must contain everything it needs to perform all of it's use cases. Module A is an order module. Most likely, an order module without a customer is useless.

    What you need to build is:

    Module A - Orders - (Order, Customer, Tax....) Module B - Customers (Customer, Address, Contacts...)

    Both modules have a Customer entity. And those entities are different

    If you have that setup, the next step may be using a distributed event bus inside the consuming application to sync data between those two modules. You could implement it like described here: https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#entity-synchronizer

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19