Should I use event design when handling no-idempotent invocation? -
i'm working on air booking project. the image below shows domain model develop far. we define domain service (airbookservice) encapsulates booking, ticketing , other operations. our suppliers provides remote-procedure-call api handle these requests, implement domain service adding anti-corruption-layer(we have multiple suppliers). this solution works fine when dealing imdenpotent rpc calls such getting price. however, there risks when dealing non-imdenpotent rpc calls. for example public class transactionalreservationhandlingserviceimpl .... { @transactional @override public void modifytraveler(string resid, string tktid, airtravler traveler) { airreservation res = reservationrepository.findby(resid); res.modify(tktid, traveler); airbookservice.modify(res, traveler); reservationrepository.store(res); } } i place airbookservice.modify() behind res.modify(), rpc call avoided if local domain logic broken. if rpc ca...