@Override public void dispatch(Notification notification, Context context) { // "null" is passed as a 2nd argument because this dispatcher is not a per-project dispatcher Multimap<String, NotificationChannel> subscribedRecipients = notificationManager.findSubscribedRecipientsForDispatcher(this, null); List<String> userLogins = propertiesDao.findUserIdsForFavouriteResource( Long.parseLong(notification.getFieldValue("projectId"))); for (String userLogin : userLogins) { Collection<NotificationChannel> channels = subscribedRecipients.get(userLogin); for (NotificationChannel channel : channels) { context.addUser(userLogin, channel); } } }