List<Notification> notifications =
this.listUnpublishedNotifications(
publishedNotificationTracker.mostRecentPublishedNotificationId());
MessageProducer messageProducer = this.messageProducer();
try {
for (Notification notification : notifications) {
this.publish(notification, messageProducer);
}
this.publishedNotificationTrackerStore()
.trackMostRecentPublishedNotification(
publishedNotificationTracker,
notifications);
} finally {
messageProducer.close();
}
}