agave-notifications/notifications-core/src/main/java/org/iplantc/service/notification/managers/NotificationManager.java
/**
	 * Sends off all the notifications for a particular event and UUID for
	 * processing.
	 *
	 * @param associatedUuid
	 * @param notificationEvent
	 * @param affectedUser
	 * @param customData serialized custom data to be included in the message
	 * @return number of messages published for the given event
	 */
Sends off all the notifications for a particular event and UUID for
processing.


Sends off all the notifications for a particular event and UUID for processing .
public static int process(String associatedUuid, String notificationEvent, String affectedUser, String customData) 
	{
		MessageQueueClient queue = null;
		int totalProcessed = 0;
		try {
			queue = MessageClientFactory.getMessageClient();
			NotificationDao dao = new NotificationDao();
			for (Notification n : dao.getActiveForAssociatedUuidAndEvent(associatedUuid, notificationEvent)) {
				try {
					NotificationMessageContext messageBodyContext = new NotificationMessageContext(
							notificationEvent, customData, associatedUuid);
					NotificationMessageBody messageBody = new NotificationMessageBody(
							n.getUuid(), affectedUser, n.getTenantId(),
							messageBodyContext);
					queue.push(Settings.NOTIFICATION_TOPIC,
							Settings.NOTIFICATION_QUEUE, messageBody.toJSON());
					totalProcessed++;
				} catch (Exception e) {
					log.error("Failed to queue up notification " + n.getUuid());
				}
			}			
		} catch (MessagingException e) {
			log.error(
					"Failed to connect to the messaging queue. No notifications will be sent for "
							+ associatedUuid + " on event " + notificationEvent,
					e);
		} catch (NotificationException e) {
			log.error("Failed to process notifications for " + associatedUuid
					+ " on event " + notificationEvent, e);
		} catch (Throwable e) {
			log.error(
					"Unknown messaging exception occurred. Failed to process notifications for "
							+ associatedUuid + " on event " + notificationEvent,
					e);
		} finally {
			if (queue != null) {
				queue.stop();
			}
		}
		return totalProcessed;
	}
public static int process ( String associatedUuid , String notificationEvent , String affectedUser , String customData ) { MessageQueueClient queue = null ; int totalProcessed = 0 ; try { queue = MessageClientFactory . getMessageClient ( ) ; NotificationDao dao = new NotificationDao ( ) ; for ( Notification n : dao . getActiveForAssociatedUuidAndEvent ( associatedUuid , notificationEvent ) ) { try { NotificationMessageContext messageBodyContext = new NotificationMessageContext ( notificationEvent , customData , associatedUuid ) ; NotificationMessageBody messageBody = new NotificationMessageBody ( n . getUuid ( ) , affectedUser , n . getTenantId ( ) , messageBodyContext ) ; queue . push ( Settings . NOTIFICATION_TOPIC , Settings . NOTIFICATION_QUEUE , messageBody . toJSON ( ) ) ; totalProcessed ++ ; } catch ( Exception e ) { log . error ( "Failed to queue up notification " + n . getUuid ( ) ) ; } } } catch ( MessagingException e ) { log . error ( "Failed to connect to the messaging queue. No notifications will be sent for " + associatedUuid + " on event " + notificationEvent , e ) ; } catch ( NotificationException e ) { log . error ( "Failed to process notifications for " + associatedUuid + " on event " + notificationEvent , e ) ; } catch ( Throwable e ) { log . error ( "Unknown messaging exception occurred. Failed to process notifications for " + associatedUuid + " on event " + notificationEvent , e ) ; } finally { if ( queue != null ) { queue . stop ( ) ; } } return totalProcessed ; }
Sends off all the notifications for a particular event and UUID for
 processing.
Sends off all the notifications for a particular event and UUID for processing .
// find all messages that match the given event and uuid and throw // them into queue