簡體   English   中英

動態隊列的Hazelcast隊列配置

[英]Hazelcast queue configuration of dynamic queues

我有一個創建動態隊列的系統。 這些隊列在消息類型上都相似。

我需要隊列中的持久性,所以我實現了一個QueueStore。 問題是要設置持久性,我需要知道隊列的名稱,並且名稱是動態的。 有沒有辦法給所有隊列相同的配置? 更好的是必須基於隊列名稱的某種模式進行不同的配置。

到目前為止,這就是我所擁有的。

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