简体   繁体   English

动态队列的Hazelcast队列配置

[英]Hazelcast queue configuration of dynamic queues

I have a system where dynamic queues are created. 我有一个创建动态队列的系统。 These queues are all similar in the type of messages. 这些队列在消息类型上都相似。

I need persistence in my queues so I implemented a QueueStore. 我需要队列中的持久性,所以我实现了一个QueueStore。 Problem is that to setup persistence I need to know the names of the queues and the names are dynamic. 问题是要设置持久性,我需要知道队列的名称,并且名称是动态的。 Is there a way to give all queues the same configuration? 有没有办法给所有队列相同的配置? Even better has to have a different configuration based of some pattern of the queue name. 更好的是必须基于队列名称的某种模式进行不同的配置。

This is what I have so far. 到目前为止,这就是我所拥有的。

final QueueStoreConfig queueStoreConfig = new QueueStoreConfig()
    .setFactoryImplementation(
        (name, properties) -> new GenericQueueStore(name, properties)
    );

final QueueConfig myQueueConfig = new QueueConfig()
    .setName("myQueue")
    .setQueueStoreConfig(queueStoreConfig);

final QueueConfig myQueueConfig2 = new QueueConfig()
    .setName("myQueue2")
    .setQueueStoreConfig(queueStoreConfig);


return new Config()
    .addQueueConfig(myQueueConfig)
    .addQueueConfig(myQueueConfig2);

要使用相同的配置来配置多个数据结构,您可以按照文档中的说明使用config wildcards和命名模式: http : //docs.hazelcast.org/docs/3.6/manual/html-single/index.html#using-通配符

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM