exchange.setProperty(MessageExchangeImpl.SERVICE_ENDPOINT_PROP, se);
}
// Re-process JBI addressing
DeliveryChannelImpl.createTarget(getChannel().getNMR(), exchange);
// TODO: read exchange properties
Message msg = (Message) ((ObjectMessage) message).getObject();
exchange.setIn(msg);
exchanges.put(exchange.getId(), exchange);
if (pendingExchanges.incrementAndGet() >= maxPendingExchanges) {
if (pauseConsumption.compareAndSet(false, true)) {
invalidateSelector();
}
}
exchange.setProperty(PROPERTY_CORR_ID + "." + name, exchange.getId());
requestor.suspend(exchange.getId());
if (requestor.getTransaction() != null) {
exchange.setProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME, requestor.getTransaction());
}
send(exchange);
break;
}
case JBI_MESSAGE_OUT: {
String corrId = message.getStringProperty(PROPERTY_CORR_ID);
if (corrId == null) {
throw new IllegalStateException("Incoming JMS message has no correlationId");
}
Exchange exchange = exchanges.get(corrId);
if (exchange == null) {
throw new IllegalStateException("Exchange not found for id " + corrId);
}
Message msg = (Message) ((ObjectMessage) message).getObject();
exchange.setOut(msg);
exchanges.put(exchange.getId(), exchange);
exchange.setProperty(PROPERTY_CORR_ID + "." + name, exchange.getId());
requestor.suspend(exchange.getId());
if (requestor.getTransaction() != null) {
exchange.setProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME, requestor.getTransaction());
}
send(exchange);
break;
}
case JBI_MESSAGE_FAULT: {
String corrId = message.getStringProperty(PROPERTY_CORR_ID);
if (corrId == null) {
throw new IllegalStateException("Incoming JMS message has no correlationId");
}
Exchange exchange = exchanges.get(corrId);
if (exchange == null) {
throw new IllegalStateException("Exchange not found for id " + corrId);
}
Message msg = (Message) ((ObjectMessage) message).getObject();
exchange.setFault(msg);
exchanges.put(exchange.getId(), exchange);
exchange.setProperty(PROPERTY_CORR_ID + "." + name, exchange.getId());
requestor.suspend(exchange.getId());
if (requestor.getTransaction() != null) {