final Map<SalesforceConsumer, ClientSessionChannel.MessageListener> map =
new HashMap<SalesforceConsumer, ClientSessionChannel.MessageListener>();
map.putAll(listenerMap);
listenerMap.clear();
for (Map.Entry<SalesforceConsumer, ClientSessionChannel.MessageListener> entry : map.entrySet()) {
final SalesforceConsumer consumer = entry.getKey();
final String topicName = consumer.getTopicName();
try {
subscribe(topicName, consumer);
} catch (CamelException e) {
// let the consumer handle the exception
consumer.handleException(
String.format("Error refreshing subscription to topic [%s]: %s",
topicName, e.getMessage()),
e);
}
}