O'Reilly logo

Implementing Domain-Driven Design by Vaughn Vernon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Publishing Message-Based Notifications

The NotificationService provides a single method for publishing DomainEvent instances over a messaging infrastructure. Here is the service method:

public class NotificationService {     ...     @Transactional     public void publishNotifications() {         PublishedMessageTracker publishedMessageTracker =             this.publishedMessageTracker();         List<Notification> notifications =             this.listUnpublishedNotifications(                     publishedMessageTracker                             .mostRecentPublishedMessageId());         MessageProducer messageProducer = this.messageProducer();         try {             for (Notification notification : notifications) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required