use of com.ing.ifsa.IFSATimeOutMessage in project iaf by ibissource.
the class IfsaRequesterSender method getRawReplyMessage.
/**
* Retrieves a message with the specified correlationId from queue or other channel, but does no processing on it.
*/
private Message getRawReplyMessage(QueueSession session, IFSAQueue queue, TextMessage sentMessage) throws SenderException, TimeOutException {
String selector = null;
Message msg = null;
QueueReceiver replyReceiver = null;
try {
replyReceiver = getReplyReceiver(session, sentMessage);
selector = replyReceiver.getMessageSelector();
long timeout = getExpiry(queue);
log.debug(getLogPrefix() + "start waiting at most [" + timeout + "] ms for reply on message using selector [" + selector + "]");
msg = replyReceiver.receive(timeout);
if (msg == null) {
log.info(getLogPrefix() + "received null reply");
} else {
log.info(getLogPrefix() + "received reply");
}
} catch (Exception e) {
throw new SenderException(getLogPrefix() + "got exception retrieving reply", e);
} finally {
try {
closeReplyReceiver(replyReceiver);
} catch (IfsaException e) {
log.error(getLogPrefix() + "error closing replyreceiver", e);
}
}
if (msg == null) {
throw new TimeOutException(getLogPrefix() + " timed out waiting for reply using selector [" + selector + "]");
}
if (msg instanceof IFSATimeOutMessage) {
throw new TimeOutException(getLogPrefix() + "received IFSATimeOutMessage waiting for reply using selector [" + selector + "]");
}
return msg;
// try {
// TextMessage result = (TextMessage)msg;
// return result;
// } catch (Exception e) {
// throw new SenderException(getLogPrefix()+"reply received for message using selector ["+selector+"] cannot be cast to TextMessage ["+msg.getClass().getName()+"]",e);
// }
}
Aggregations