use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.
the class AddTopicConfigMessageTask method getConfig.
@Override
protected IdentifiedDataSerializable getConfig() {
TopicConfig config = new TopicConfig(parameters.name);
config.setGlobalOrderingEnabled(parameters.globalOrderingEnabled);
config.setMultiThreadingEnabled(parameters.multiThreadingEnabled);
config.setStatisticsEnabled(parameters.statisticsEnabled);
if (parameters.listenerConfigs != null && !parameters.listenerConfigs.isEmpty()) {
config.setMessageListenerConfigs((List<ListenerConfig>) adaptListenerConfigs(parameters.listenerConfigs));
}
return config;
}
use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleTopic.
protected void handleTopic(Node node) {
Node attName = getNamedItemNode(node, "name");
String name = getTextContent(attName);
TopicConfig tConfig = new TopicConfig();
tConfig.setName(name);
handleTopicNode(node, tConfig);
}
use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.
the class TopicStressTest method setUp.
@Before
public void setUp() {
TopicConfig topicConfig = new TopicConfig();
topicConfig.setName("topic*");
topicConfig.setMultiThreadingEnabled(multiThreadingEnabled);
Config config = new Config();
config.addTopicConfig(topicConfig);
instances = createHazelcastInstanceFactory(NODE_COUNT).newInstances(config);
startLatch = new CountDownLatch(1);
publishThreads = new PublishThread[PUBLISH_THREAD_COUNT];
for (int threadIndex = 0; threadIndex < publishThreads.length; threadIndex++) {
PublishThread publishThread = new PublishThread(startLatch);
publishThread.start();
publishThreads[threadIndex] = publishThread;
}
listenerMap = new HashMap<String, List<MessageListenerImpl>>();
for (int topicIndex = 0; topicIndex < TOPIC_COUNT; topicIndex++) {
String topicName = getTopicName(topicIndex);
List<MessageListenerImpl> listeners = registerTopicListeners(topicName, instances);
listenerMap.put(topicName, listeners);
}
}
use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.
the class AbstractDynamicConfigGeneratorTest method testTopicMultiThreaded.
@Test
public void testTopicMultiThreaded() {
String testTopic = "TestTopic";
Config cfg = new Config();
TopicConfig expectedConfig = new TopicConfig().setName(testTopic).setMultiThreadingEnabled(true).setStatisticsEnabled(true).setMessageListenerConfigs(singletonList(new ListenerConfig("foo.bar.Listener")));
cfg.addTopicConfig(expectedConfig);
TopicConfig actualConfig = getNewConfigViaGenerator(cfg).getTopicConfig(testTopic);
assertEquals(expectedConfig, actualConfig);
}
use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.
the class AbstractDynamicConfigGeneratorTest method testTopicGlobalOrdered.
// TOPIC
@Test
public void testTopicGlobalOrdered() {
Config cfg = new Config();
TopicConfig expectedConfig = new TopicConfig().setName("TestTopic").setGlobalOrderingEnabled(true).setStatisticsEnabled(true).setMessageListenerConfigs(singletonList(new ListenerConfig("foo.bar.Listener")));
cfg.addTopicConfig(expectedConfig);
TopicConfig actualConfig = getNewConfigViaGenerator(cfg).getTopicConfig("TestTopic");
assertEquals(expectedConfig, actualConfig);
}
Aggregations