}
else
{
Logger.getInstance().logWarn("Maximum number of queue retries exceeded, message lost.", null, getGatewayId());
msg.setFailureCause(FailureCauses.UNKNOWN);
Service.getInstance().getNotifyQueueManager().getNotifyQueue().add(new OutboundMessageNotification(getMyself(), msg));
}
}
else
{
Service.getInstance().getNotifyQueueManager().getNotifyQueue().add(new OutboundMessageNotification(getMyself(), msg));
}
}
catch (TimeoutException e)
{
Service.getInstance().getQueueManager().queueMessage(msg);
throw e;
}
}
}
}
catch (InterruptedException e)
{
if ((msg != null) && (msg.getMessageStatus() != MessageStatuses.SENT)) Service.getInstance().getQueueManager().queueMessage(msg);
Logger.getInstance().logInfo("QueueManager interrupted.", e, getGatewayId());
}
catch (Exception e)
{
Logger.getInstance().logWarn("Queue exception, marking gateway for reset.", e, getGatewayId());
setStatus(GatewayStatuses.RESTART);
Service.getInstance().getNotifyQueueManager().getNotifyQueue().add(new OutboundMessageNotification(getMyself(), msg));
}
}