Try PubSub+

How to prevent queue creating automatically from the programming?

UmeshUmesh Member Posts: 1
edited March 2 in General Discussions #1

Hello Team,

Our Requirement:
Solace DEV team will create few queues in the solace portal and they will send the queue list to the application development team to consume messages from available queues.

Application DEV team should not create any new queues programmatically/manually from code. They have to only consume messages from the available queues.
Issue:
If the solace DEV team deletes one queue from the portal and if the application code still trying to consume message for the deleted queue. Instead of throwing an error, it's creating a new queue for the deleted queue(which deleted by the solace DEV team) programmatically. We are referring to the below code to initialize the queue object.

JAVA: final Queue queue = JCSMPFactory.onlyInstance().createQueue(queueName);
C#: IQueue queue = ContextFactory.Instance.CreateQueue(kvp.SolaceQueueName);

Please can you help me to prevent creating a queue programmatically?
Regards,
Umesh
[email protected]

Comments

  • manishmanish Member Posts: 38 ✭✭✭
    edited March 2 #2

    Hi Umesh,
    I think you are using Queue creator class code in Java to create a Queue using below as per your question and you are passing some value of in varibale queueName="YourQueueNametoBeProvision" .
    final Queue queue = JCSMPFactory.onlyInstance().createQueue(queueName);
    or set the property in provision method JCSMPSession.FLAG_IGNORE_DOES_NOT_EXIST
    Please let me know if you find any other solution.

  • rlawrencerlawrence Member, Employee Posts: 6 Solace Employee

    Hi @Umesh the createQueue() method only creates a local queue object for the client application. To dynamically create a queue on the broker a client application would use the session provision() method. To prevent the queue being dynamically provisioned on the broker check your client code and remove the provision() method call, or alternatively you can prevent dynamic endpoints by disabling "Allow Client to Create Endpoints" in the client profile used by the application.
    HTH

Sign In or Register to comment.