Solace Community is getting a facelift!

On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.

We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!

Can durable queue be created in producer flow using solclientjs package in nodejs?

prashantk2000
prashantk2000 Member Posts: 33 ✭✭
edited December 2022 in PubSub+ Event Broker #1

Does createDurableQueueDestination() method in solClientFactory creates durable queue if not exist in producer flow?

var message = solace.SolclientFactory.createMessage();
        message.setDestination(solace.SolclientFactory.createDurableQueueDestination(producer.queueName));
        message.setBinaryAttachment(messageText);
        message.setDeliveryMode(solace.MessageDeliveryModeType.PERSISTENT);'''

nodejs package - solclientjs

Solace pubsub broker version - 10.1.1.29

Tagged:

Best Answer

  • giri
    giri Member, Administrator, Employee Posts: 116 admin
    #2 Answer ✓

    Hi @prashantk2000 - No, it doesn't; It simply sets the destination on the message.

    Queues are lifecycle-managed resources and must be created on a connected session via acreateMessageConsumer call.

    Here a queue can be created if found missing

    subscriber.messageSubscriber = subscriber.session.createMessageConsumer({
       // solace.MessageConsumerProperties
       queueDescriptor: { name: consumer.queueName, type: solace.QueueType.QUEUE },
       acknowledgeMode: solace.MessageConsumerAcknowledgeMode.CLIENT,
       createIfMissing: true,
    });
    


Answers

  • giri
    giri Member, Administrator, Employee Posts: 116 admin
    #3 Answer ✓

    Hi @prashantk2000 - No, it doesn't; It simply sets the destination on the message.

    Queues are lifecycle-managed resources and must be created on a connected session via acreateMessageConsumer call.

    Here a queue can be created if found missing

    subscriber.messageSubscriber = subscriber.session.createMessageConsumer({
       // solace.MessageConsumerProperties
       queueDescriptor: { name: consumer.queueName, type: solace.QueueType.QUEUE },
       acknowledgeMode: solace.MessageConsumerAcknowledgeMode.CLIENT,
       createIfMissing: true,
    });
    


  • prashantk2000
    prashantk2000 Member Posts: 33 ✭✭

    Thanks @giri

    Yes I see the same behavior in producer flow. Initially I thought SolclientFactory.createDurableQueueDestination(String queueName ) will create durable queue but it only creates destination instance and not the durable queue. https://docs.solace.com/API-Developer-Online-Ref-Documentation/nodejs/solace.SolclientFactory.html#createDurableQueueDestination

This Month's Leaders

This Week's Leaders