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