Map transportHeaders = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS);
if (transportHeaders != null && !transportHeaders.values().isEmpty()) {
for (Object o : transportHeaders.keySet()) {
Object value = transportHeaders.get(o);
if (value != null && o instanceof String && value instanceof String) {
sourceResponse.addHeader((String) o, (String) value);
}
}
}
return sourceResponse;