I am trying to assess the viability of microservices/DDD for an application I am writing, for which a particular context/service needs to respond to an action completing in another context. Whilst previously I would handle this via integration events published to a message queue, I haven't had to deal with events which could contain large amounts of data
As a generic example. Let's say we have an Orders and Invoicing context. When an order is placed, an invoice needs to be generated and sent out.
With those bits of information I would raise an OrderPlaced event with the order information in, for example:
public class OrderPlacedEvent
{
public Guid Id { get; }
public List<OrderItem> Items { get; }
public DateTime PlacedOn { get; }
}
from the Orders context, and the Invoicing context would consume this event to generate the required invoice. This seems fairly standard but all examples found are fairly small and don't seem to address what would happen if the order has 1000+ items in the order, and it leads me to believe that maybe integration events are only intended for small pieces of information
The 'easiest' way would be to just use an order ID and query the orders service to get the rest of the information, but this would add coupling between the two services which the approach is trying to remove.
Is my assumption that event data should be minimal correct? if it is, how would I (or even, is it possible to?) handle such a scenario where there are large pieces of data which another context/service needs to respond to, correctly?