Search in sources :

Example 11 with TopicConfig

use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.

the class DynamicConfigTest method testTopicConfig_whenListenerConfigByClassName.

@Test
public void testTopicConfig_whenListenerConfigByClassName() {
    TopicConfig topicConfig = new TopicConfig(name).setGlobalOrderingEnabled(false).setMultiThreadingEnabled(true).setStatisticsEnabled(true).addMessageListenerConfig(getListenerConfig_byClassName());
    driver.getConfig().addTopicConfig(topicConfig);
    assertConfigurationsEqualOnAllMembers(topicConfig);
}
Also used : ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) TopicConfig(com.hazelcast.config.TopicConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 12 with TopicConfig

use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.

the class DynamicConfigSmokeTest method topic_initialSubmitTest.

@Test
public void topic_initialSubmitTest() {
    String topicName = randomName();
    String listenerClassName = randomName();
    HazelcastInstance[] instances = members(DEFAULT_INITIAL_CLUSTER_SIZE);
    HazelcastInstance driver = driver();
    TopicConfig topicConfig = new TopicConfig(topicName);
    topicConfig.addMessageListenerConfig(new ListenerConfig(listenerClassName));
    driver.getConfig().addTopicConfig(topicConfig);
    for (HazelcastInstance instance : instances) {
        topicConfig = instance.getConfig().getTopicConfig(topicName);
        assertEquals(listenerClassName, topicConfig.getMessageListenerConfigs().get(0).getClassName());
    }
}
Also used : ListenerConfig(com.hazelcast.config.ListenerConfig) HazelcastInstance(com.hazelcast.core.HazelcastInstance) TopicConfig(com.hazelcast.config.TopicConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 13 with TopicConfig

use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.

the class DynamicConfigTest method testTopicConfig_whenListenerConfigByImplementation.

@Test
public void testTopicConfig_whenListenerConfigByImplementation() {
    TopicConfig topicConfig = new TopicConfig(name).setGlobalOrderingEnabled(false).setMultiThreadingEnabled(true).setStatisticsEnabled(true).addMessageListenerConfig(getMessageListenerConfig_byImplementation());
    driver.getConfig().addTopicConfig(topicConfig);
    assertConfigurationsEqualOnAllMembers(topicConfig);
}
Also used : ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) TopicConfig(com.hazelcast.config.TopicConfig) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 14 with TopicConfig

use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.

the class AddTopicConfigMessageTask method checkStaticConfigDoesNotExist.

@Override
protected boolean checkStaticConfigDoesNotExist(IdentifiedDataSerializable config) {
    DynamicConfigurationAwareConfig nodeConfig = (DynamicConfigurationAwareConfig) nodeEngine.getConfig();
    TopicConfig topicConfig = (TopicConfig) config;
    return nodeConfig.checkStaticConfigDoesNotExist(nodeConfig.getStaticConfig().getTopicConfigs(), topicConfig.getName(), topicConfig);
}
Also used : DynamicConfigurationAwareConfig(com.hazelcast.internal.dynamicconfig.DynamicConfigurationAwareConfig) TopicConfig(com.hazelcast.config.TopicConfig)

Example 15 with TopicConfig

use of com.hazelcast.config.TopicConfig in project hazelcast by hazelcast.

the class TestFullApplicationContext method testTopicConfig.

@Test
public void testTopicConfig() {
    TopicConfig testTopicConfig = config.getTopicConfig("testTopic");
    assertNotNull(testTopicConfig);
    assertEquals("testTopic", testTopicConfig.getName());
    assertEquals(1, testTopicConfig.getMessageListenerConfigs().size());
    assertTrue(testTopicConfig.isGlobalOrderingEnabled());
    assertFalse(testTopicConfig.isStatisticsEnabled());
    ListenerConfig listenerConfig = testTopicConfig.getMessageListenerConfigs().get(0);
    assertEquals("com.hazelcast.spring.DummyMessageListener", listenerConfig.getClassName());
}
Also used : EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) TopicConfig(com.hazelcast.config.TopicConfig) Test(org.junit.Test) QuickTest(com.hazelcast.test.annotation.QuickTest)

Aggregations

TopicConfig (com.hazelcast.config.TopicConfig)23 ReliableTopicConfig (com.hazelcast.config.ReliableTopicConfig)16 ListenerConfig (com.hazelcast.config.ListenerConfig)9 Test (org.junit.Test)9 Config (com.hazelcast.config.Config)8 RingbufferConfig (com.hazelcast.config.RingbufferConfig)8 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)7 CardinalityEstimatorConfig (com.hazelcast.config.CardinalityEstimatorConfig)7 DurableExecutorConfig (com.hazelcast.config.DurableExecutorConfig)7 ExecutorConfig (com.hazelcast.config.ExecutorConfig)7 FlakeIdGeneratorConfig (com.hazelcast.config.FlakeIdGeneratorConfig)7 ListConfig (com.hazelcast.config.ListConfig)7 MapConfig (com.hazelcast.config.MapConfig)7 MultiMapConfig (com.hazelcast.config.MultiMapConfig)7 PNCounterConfig (com.hazelcast.config.PNCounterConfig)7 QueueConfig (com.hazelcast.config.QueueConfig)7 ReplicatedMapConfig (com.hazelcast.config.ReplicatedMapConfig)7 ScheduledExecutorConfig (com.hazelcast.config.ScheduledExecutorConfig)7 SetConfig (com.hazelcast.config.SetConfig)7 QuickTest (com.hazelcast.test.annotation.QuickTest)7