agave-notifications/notifications-core/src/main/java/org/iplantc/service/notification/events/NotificationAttemptProcessor.java
/**
	 * Writes a {@link NotificationAttempt} to the retry message queue
	 * for execution after a delay of {@code secondsUntilNextScheduledAttempt} seconds.
	 * 
	 * @param attempt
	 * @param secondsUntilNextScheduledAttempt
	 */
Writes a  NotificationAttempt to the retry message queue
for execution after a delay of  secondsUntilNextScheduledAttempt seconds.

@param attempt
@param secondsUntilNextScheduledAttempt
Writes a NotificationAttempt to the retry message queue for execution after a delay of secondsUntilNextScheduledAttempt seconds . @param attempt @param secondsUntilNextScheduledAttempt
protected void pushNotificationAttemptToRetryQueue(NotificationAttempt attempt, int secondsUntilNextScheduledAttempt) {
		MessageQueueClient queue = null;
		try {
			ObjectMapper mapper = new ObjectMapper();
			queue = MessageClientFactory.getMessageClient();
			queue.push(Settings.NOTIFICATION_RETRY_TOPIC,
					Settings.NOTIFICATION_RETRY_QUEUE, mapper.writeValueAsString(attempt), 
					secondsUntilNextScheduledAttempt);
		} 
		catch (MessagingException e) {
			log.error("Failed to connect to the messaging queue. Unable to return " + 
					attempt.getAttemptNumber() + " for notification " + attempt.getNotificationId(),
					e);
			saveFailedAttempt(attempt);
		} 
		catch (Throwable e) {
			log.error("Unexpected failure returning notification attempt " + 
					attempt.getAttemptNumber() + " for notification " + attempt.getNotificationId() + 
					" to the retry attempt queue.",
					e);
			saveFailedAttempt(attempt);
		} 
		finally {
			if (queue != null) {
				queue.stop();
			}
		}
	}
protected void pushNotificationAttemptToRetryQueue ( NotificationAttempt attempt , int secondsUntilNextScheduledAttempt ) { MessageQueueClient queue = null ; try { ObjectMapper mapper = new ObjectMapper ( ) ; queue = MessageClientFactory . getMessageClient ( ) ; queue . push ( Settings . NOTIFICATION_RETRY_TOPIC , Settings . NOTIFICATION_RETRY_QUEUE , mapper . writeValueAsString ( attempt ) , secondsUntilNextScheduledAttempt ) ; } catch ( MessagingException e ) { log . error ( "Failed to connect to the messaging queue. Unable to return " + attempt . getAttemptNumber ( ) + " for notification " + attempt . getNotificationId ( ) , e ) ; saveFailedAttempt ( attempt ) ; } catch ( Throwable e ) { log . error ( "Unexpected failure returning notification attempt " + attempt . getAttemptNumber ( ) + " for notification " + attempt . getNotificationId ( ) + " to the retry attempt queue." , e ) ; saveFailedAttempt ( attempt ) ; } finally { if ( queue != null ) { queue . stop ( ) ; } } }
Writes a {@link NotificationAttempt} to the retry message queue
 for execution after a delay of {@code secondsUntilNextScheduledAttempt} seconds.
Writes a { @link NotificationAttempt } to the retry message queue for execution after a delay of { @code secondsUntilNextScheduledAttempt } seconds .