// this works around a bug in the ActiveMQ property handling
map.put("JMSXGroupID", jmsMessage.getStringProperty("JMSXGroupID"));
map.put("JMSXUserID", jmsMessage.getStringProperty("JMSXUserID"));
} catch (JMSException e) {
throw new RuntimeCamelException(e);
}
Enumeration<?> names;
try {
names = jmsMessage.getPropertyNames();
} catch (JMSException e) {
throw new RuntimeCamelException(e);
}
while (names.hasMoreElements()) {
String name = names.nextElement().toString();
try {
Object value = JmsMessageHelper.getProperty(jmsMessage, name);
if (headerFilterStrategy != null
&& headerFilterStrategy.applyFilterToExternalHeaders(name, value, exchange)) {
continue;
}
// must decode back from safe JMS header name to original header name
// when storing on this Camel JmsMessage object.
String key = jmsKeyFormatStrategy.decodeKey(name);
map.put(key, value);
} catch (JMSException e) {
throw new RuntimeCamelException(name, e);
}
}
}
return map;