MutinyEmitter sends reactive-messaging messages while representing completion as a Mutiny Uni. This lets message acknowledgment join an existing reactive pipeline instead of being handled separately through CompletionStage. section 9.4
Use MutinyEmitter to coordinate asynchronous message delivery with request processing:
- Inject MutinyEmitter with a channel such as invoices and send an event containing the persisted reservation and computed price. section 9.4
- Treat the returned Uni as successful only when the produced message is acknowledged; propagate failures so the request reports the problem. section 9.4
- Attach onFailure().invoke for logging while returning the same Uni to preserve asynchronous success and failure behavior. section 9.4
Reservation and invoice processing
A reservation endpoint persists a reservation, sends an invoice message, and continues the rental flow only after the Billing service acknowledges it. If invoice creation fails, the failure is logged and propagated to the caller. section 9.4
Figure 9.6 The reactive messaging integration in the Reservation service
Shows how reactive messaging connects the Reservation service with downstream invoice processing. section 9.4
