LOGGER.debug("Submit request " + request.debugString());
}
// Get a session from the pool and attempt to send the message.
boolean submitted = false;
SubmitSMResp response = null;
while (!submitted) {
Session SMSSession = (Session) sessionPool.borrowObject();
try {
response = SMSSession.submit(request);
submitted = true;
sessionPool.returnObject(SMSSession);
} catch (Exception e) {
LOGGER.warn("message-submit-failure-retrying", e.getMessage());
sessionPool.invalidateObject(SMSSession);
}
}
if(response!=null){
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("Submit response " +
response.debugString());
}
if (response.getCommandStatus() != Data.ESME_ROK) {
final MessageRecipient failedRecipient =
message.getMessageRecipient(i);
failedRecipient.setFailureReason(
localizer.format("message-submit-failure-with-status",
new Integer(response.getCommandStatus())));
failedRecipients.add(failedRecipient);
}
}
} catch (Exception e) {
final MessageRecipient failedRecipient =