subStats.incrementFailedOps();
return;
}
}
// initialize the message filter
PipelineFilter filter = new PipelineFilter();
try {
// the filter pipeline should be
// 1) AllToAllTopologyFilter to filter cross-region messages
filter.addLast(new AllToAllTopologyFilter());
// 2) User-Customized MessageFilter
if (subData.hasPreferences() &&
subData.getPreferences().hasMessageFilter()) {
String messageFilterName = subData.getPreferences().getMessageFilter();
filter.addLast(ReflectionUtils.newInstance(messageFilterName, ServerMessageFilter.class));
}
// initialize the filter
filter.initialize(cfg.getConf());
filter.setSubscriptionPreferences(topic, subscriberId,
subData.getPreferences());
} catch (RuntimeException re) {
String errMsg = "RuntimeException caught when instantiating message filter for (topic:"
+ topic.toStringUtf8() + ", subscriber:" + subscriberId.toStringUtf8() + ")."
+ "It might be introduced by programming error in message filter.";