Practical Domain-Driven Design in Enterprise Java by Vijay Nair

Practical Domain-Driven Design in Enterprise Java by Vijay Nair

Author:Vijay Nair
Language: eng
Format: epub
ISBN: 9781484245439
Publisher: Apress


1.Application Services classes receive Commands/Queries/Events.

2.As part of the processing, if it requires an interaction with another Bounded Context’s API using REST, it makes use of an Outbound Service.

3.The Outbound service uses a Type safe Rest client to invoke the Bounded Context’s API. It also performs the translation from the data format provided by that Bounded Context’s API to the data model recognized by the current Bounded Context.

Outbound Services: Message Broker

The final type of outbound service that needs to be implemented is the interactions with Message Brokers. Message Brokers provide the necessary physical infrastructure for publishing/subscribing of Domain Events.

We have seen a couple of our Event classes (CargoBooked, CargoRouted) implemented using custom annotations. We have also seen the implementation of publishing them (using the fire() method) as well as subscribing them (using the observes() method).

Let us look at an implementation of how we can enable the publishing and subscribing of these events from a RabbitMQ server’s Queues/Exchanges.

Do note that neither the Eclipse MicroProfile platform nor Helidon MP’s extensions provide capabilities to help CDI Events being published onto RabbitMQ, so we need to provide our own implementation for this. The source code of the chapter provides a separate project (cargo-tracker-rabbimq-adaptor). This project provides the following:Infrastructural capabilities (Connection Factories for RabbitMQ services, Managed Publishers, and Managed Consumers)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.