Search in sources :

Example 6 with QueueConfig

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

the class QueueReplicationOperation method run.

@Override
public void run() {
    QueueService service = getService();
    NodeEngine nodeEngine = getNodeEngine();
    Config config = nodeEngine.getConfig();
    for (Map.Entry<String, QueueContainer> entry : migrationData.entrySet()) {
        String name = entry.getKey();
        QueueContainer container = entry.getValue();
        QueueConfig conf = config.findQueueConfig(name);
        container.setConfig(conf, nodeEngine, service);
        service.addContainer(name, container);
    }
}
Also used : NodeEngine(com.hazelcast.spi.NodeEngine) QueueConfig(com.hazelcast.config.QueueConfig) Config(com.hazelcast.config.Config) QueueConfig(com.hazelcast.config.QueueConfig) QueueContainer(com.hazelcast.collection.impl.queue.QueueContainer) QueueService(com.hazelcast.collection.impl.queue.QueueService) HashMap(java.util.HashMap) Map(java.util.Map)

Example 7 with QueueConfig

use of com.hazelcast.config.QueueConfig in project spring-boot by spring-projects.

the class HazelcastAutoConfigurationTests method configInstanceWithoutName.

@Test
public void configInstanceWithoutName() {
    load(HazelcastConfigNoName.class, "spring.hazelcast.config=this-is-ignored.xml");
    HazelcastInstance hazelcastInstance = this.context.getBean(HazelcastInstance.class);
    Map<String, QueueConfig> queueConfigs = hazelcastInstance.getConfig().getQueueConfigs();
    assertThat(queueConfigs).hasSize(1).containsKey("another-queue");
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) QueueConfig(com.hazelcast.config.QueueConfig) Test(org.junit.Test)

Example 8 with QueueConfig

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

the class PartitionedCluster method createFiveMemberCluster.

public PartitionedCluster createFiveMemberCluster(QueueConfig queueConfig, QuorumConfig quorumConfig) {
    Config config = createClusterConfig().addQueueConfig(queueConfig).addQuorumConfig(quorumConfig);
    createInstances(config);
    return this;
}
Also used : Config(com.hazelcast.config.Config) QueueConfig(com.hazelcast.config.QueueConfig) CacheSimpleConfig(com.hazelcast.config.CacheSimpleConfig) LockConfig(com.hazelcast.config.LockConfig) MapConfig(com.hazelcast.config.MapConfig) QuorumConfig(com.hazelcast.config.QuorumConfig)

Example 9 with QueueConfig

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

the class AbstractQueueQuorumTest method initializeFiveMemberCluster.

protected static void initializeFiveMemberCluster(QuorumType type, int quorumSize) {
    QuorumConfig quorumConfig = new QuorumConfig().setName(QUORUM_ID).setType(type).setEnabled(true).setSize(quorumSize);
    QueueConfig qConfig = new QueueConfig(QUEUE_NAME_PREFIX + "*").setBackupCount(4).setQuorumName(QUORUM_ID);
    cluster = new PartitionedCluster(new TestHazelcastInstanceFactory());
    cluster.createFiveMemberCluster(qConfig, quorumConfig);
    q1 = getQueue(cluster.h1);
    q2 = getQueue(cluster.h2);
    q3 = getQueue(cluster.h3);
    q4 = getQueue(cluster.h4);
    q5 = getQueue(cluster.h5);
}
Also used : QuorumConfig(com.hazelcast.config.QuorumConfig) QueueConfig(com.hazelcast.config.QueueConfig) PartitionedCluster(com.hazelcast.quorum.PartitionedCluster) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory)

Example 10 with QueueConfig

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

the class QueueAbstractTest method setup.

@Before
public void setup() {
    Config config = new Config();
    config.addQueueConfig(new QueueConfig("testOffer_whenFull*").setMaxSize(100));
    config.addQueueConfig(new QueueConfig("testOfferWithTimeout*").setMaxSize(100));
    instances = newInstances(config);
    HazelcastInstance local = instances[0];
    HazelcastInstance target = instances[instances.length - 1];
    String methodName = getTestMethodName();
    String name = randomNameOwnedBy(target, methodName);
    queueConfig = config.getQueueConfig(name);
    queue = local.getQueue(name);
}
Also used : QueueConfig(com.hazelcast.config.QueueConfig) HazelcastInstance(com.hazelcast.core.HazelcastInstance) Config(com.hazelcast.config.Config) QueueConfig(com.hazelcast.config.QueueConfig) Before(org.junit.Before)

Aggregations

QueueConfig (com.hazelcast.config.QueueConfig)19 Config (com.hazelcast.config.Config)14 HazelcastInstance (com.hazelcast.core.HazelcastInstance)11 Test (org.junit.Test)11 QueueStoreConfig (com.hazelcast.config.QueueStoreConfig)10 QuickTest (com.hazelcast.test.annotation.QuickTest)9 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 Before (org.junit.Before)3 ItemListenerConfig (com.hazelcast.config.ItemListenerConfig)2 QuorumConfig (com.hazelcast.config.QuorumConfig)2 QueueStore (com.hazelcast.core.QueueStore)2 QueueStoreFactory (com.hazelcast.core.QueueStoreFactory)2 QueueContainer (com.hazelcast.collection.impl.queue.QueueContainer)1 QueueService (com.hazelcast.collection.impl.queue.QueueService)1 CacheSimpleConfig (com.hazelcast.config.CacheSimpleConfig)1 LockConfig (com.hazelcast.config.LockConfig)1 MapConfig (com.hazelcast.config.MapConfig)1 PartitionedCluster (com.hazelcast.quorum.PartitionedCluster)1 NodeEngine (com.hazelcast.spi.NodeEngine)1