Can durable queue be created in producer flow using solclientjs package in nodejs?
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
Best 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 a
createMessageConsumer
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, });
2
Answers
-
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 a
createMessageConsumer
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, });
2 -
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
1