Search in sources :

Example 6 with TopicConfig

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;
}
Also used : ListenerConfig(com.hazelcast.config.ListenerConfig) TopicConfig(com.hazelcast.config.TopicConfig)

Example 7 with TopicConfig

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);
}
Also used : Node(org.w3c.dom.Node) TopicConfig(com.hazelcast.config.TopicConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig)

Example 8 with TopicConfig

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);
    }
}
Also used : Config(com.hazelcast.config.Config) TopicConfig(com.hazelcast.config.TopicConfig) List(java.util.List) LinkedList(java.util.LinkedList) CountDownLatch(java.util.concurrent.CountDownLatch) TopicConfig(com.hazelcast.config.TopicConfig) Before(org.junit.Before)

Example 9 with TopicConfig

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);
}
Also used : ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) ListConfig(com.hazelcast.config.ListConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) AwsConfig(com.hazelcast.config.AwsConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) DiscoveryStrategyConfig(com.hazelcast.config.DiscoveryStrategyConfig) DiskTierConfig(com.hazelcast.config.DiskTierConfig) IndexConfig(com.hazelcast.config.IndexConfig) NearCacheConfig(com.hazelcast.config.NearCacheConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig) WanConsumerConfig(com.hazelcast.config.WanConsumerConfig) AttributeConfig(com.hazelcast.config.AttributeConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) WanCustomPublisherConfig(com.hazelcast.config.WanCustomPublisherConfig) WanBatchPublisherConfig(com.hazelcast.config.WanBatchPublisherConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) TieredStoreConfig(com.hazelcast.config.TieredStoreConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DiscoveryConfig(com.hazelcast.config.DiscoveryConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) DataPersistenceConfig(com.hazelcast.config.DataPersistenceConfig) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) MerkleTreeConfig(com.hazelcast.config.MerkleTreeConfig) MemoryTierConfig(com.hazelcast.config.MemoryTierConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) TopicConfig(com.hazelcast.config.TopicConfig) Test(org.junit.Test)

Example 10 with TopicConfig

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);
}
Also used : ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) ListConfig(com.hazelcast.config.ListConfig) EventJournalConfig(com.hazelcast.config.EventJournalConfig) AwsConfig(com.hazelcast.config.AwsConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) MapConfig(com.hazelcast.config.MapConfig) PredicateConfig(com.hazelcast.config.PredicateConfig) MultiMapConfig(com.hazelcast.config.MultiMapConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) ExecutorConfig(com.hazelcast.config.ExecutorConfig) DiscoveryStrategyConfig(com.hazelcast.config.DiscoveryStrategyConfig) DiskTierConfig(com.hazelcast.config.DiskTierConfig) IndexConfig(com.hazelcast.config.IndexConfig) NearCacheConfig(com.hazelcast.config.NearCacheConfig) MapStoreConfig(com.hazelcast.config.MapStoreConfig) QueueStoreConfig(com.hazelcast.config.QueueStoreConfig) ItemListenerConfig(com.hazelcast.config.ItemListenerConfig) MergePolicyConfig(com.hazelcast.config.MergePolicyConfig) CacheSimpleEntryListenerConfig(com.hazelcast.config.CacheSimpleEntryListenerConfig) RingbufferStoreConfig(com.hazelcast.config.RingbufferStoreConfig) WanConsumerConfig(com.hazelcast.config.WanConsumerConfig) AttributeConfig(com.hazelcast.config.AttributeConfig) SetConfig(com.hazelcast.config.SetConfig) PNCounterConfig(com.hazelcast.config.PNCounterConfig) QueueConfig(com.hazelcast.config.QueueConfig) ListenerConfig(com.hazelcast.config.ListenerConfig) CardinalityEstimatorConfig(com.hazelcast.config.CardinalityEstimatorConfig) WanCustomPublisherConfig(com.hazelcast.config.WanCustomPublisherConfig) WanBatchPublisherConfig(com.hazelcast.config.WanBatchPublisherConfig) EntryListenerConfig(com.hazelcast.config.EntryListenerConfig) RingbufferConfig(com.hazelcast.config.RingbufferConfig) EvictionConfig(com.hazelcast.config.EvictionConfig) TieredStoreConfig(com.hazelcast.config.TieredStoreConfig) QueryCacheConfig(com.hazelcast.config.QueryCacheConfig) ScheduledExecutorConfig(com.hazelcast.config.ScheduledExecutorConfig) TopicConfig(com.hazelcast.config.TopicConfig) Config(com.hazelcast.config.Config) DiscoveryConfig(com.hazelcast.config.DiscoveryConfig) CachePartitionLostListenerConfig(com.hazelcast.config.CachePartitionLostListenerConfig) DataPersistenceConfig(com.hazelcast.config.DataPersistenceConfig) DurableExecutorConfig(com.hazelcast.config.DurableExecutorConfig) MapPartitionLostListenerConfig(com.hazelcast.config.MapPartitionLostListenerConfig) WanReplicationConfig(com.hazelcast.config.WanReplicationConfig) FlakeIdGeneratorConfig(com.hazelcast.config.FlakeIdGeneratorConfig) MerkleTreeConfig(com.hazelcast.config.MerkleTreeConfig) MemoryTierConfig(com.hazelcast.config.MemoryTierConfig) ReplicatedMapConfig(com.hazelcast.config.ReplicatedMapConfig) ReliableTopicConfig(com.hazelcast.config.ReliableTopicConfig) TopicConfig(com.hazelcast.config.TopicConfig) Test(org.junit.Test)

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