MessageImpl result = null;
Condition condition;
if (wait > 0) {
condition = TimedCondition.before(wait);
} else {
condition = new Flag(true);
}
if (!_stop.get()) {
result = doReceive(consumerId, condition);
} else {
ConsumerEndpoint consumer = getConsumer(consumerId);