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?
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