use of com.hazelcast.topic.TopicOverloadPolicy in project hazelcast by hazelcast.
the class XmlConfigBuilder method handleReliableTopic.
private void handleReliableTopic(Node node) {
Node attName = node.getAttributes().getNamedItem("name");
String name = getTextContent(attName);
ReliableTopicConfig topicConfig = new ReliableTopicConfig(name);
for (Node n : childElements(node)) {
String nodeName = cleanNodeName(n);
if ("read-batch-size".equals(nodeName)) {
String batchSize = getTextContent(n);
topicConfig.setReadBatchSize(getIntegerValue("read-batch-size", batchSize));
} else if ("statistics-enabled".equals(nodeName)) {
topicConfig.setStatisticsEnabled(getBooleanValue(getTextContent(n)));
} else if ("topic-overload-policy".equals(nodeName)) {
TopicOverloadPolicy topicOverloadPolicy = TopicOverloadPolicy.valueOf(upperCaseInternal(getTextContent(n)));
topicConfig.setTopicOverloadPolicy(topicOverloadPolicy);
} else if ("message-listeners".equals(nodeName)) {
for (Node listenerNode : childElements(n)) {
if ("message-listener".equals(cleanNodeName(listenerNode))) {
topicConfig.addMessageListenerConfig(new ListenerConfig(getTextContent(listenerNode)));
}
}
}
}
config.addReliableTopicConfig(topicConfig);
}
use of com.hazelcast.topic.TopicOverloadPolicy in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleReliableTopicNode.
void handleReliableTopicNode(Node node, final ReliableTopicConfig topicConfig) {
for (Node n : childElements(node)) {
String nodeName = cleanNodeName(n);
if (matches("read-batch-size", nodeName)) {
String batchSize = getTextContent(n);
topicConfig.setReadBatchSize(getIntegerValue("read-batch-size", batchSize));
} else if (matches("statistics-enabled", nodeName)) {
topicConfig.setStatisticsEnabled(getBooleanValue(getTextContent(n)));
} else if (matches("topic-overload-policy", nodeName)) {
TopicOverloadPolicy topicOverloadPolicy = TopicOverloadPolicy.valueOf(upperCaseInternal(getTextContent(n)));
topicConfig.setTopicOverloadPolicy(topicOverloadPolicy);
} else if (matches("message-listeners", nodeName)) {
handleMessageListeners(n, listenerConfig -> {
topicConfig.addMessageListenerConfig(listenerConfig);
return null;
});
}
}
config.addReliableTopicConfig(topicConfig);
}
Aggregations