Is there any way we can write a java code to lock/unlock the webMethods message Queue

Hi Folks,

Can you please help me on this,
I would like to write a java code in webmethods server cluster environment to lock or unlock already existing webmethods broker Queue. Is it possible to acquire this through code?
If so, pls provide any samples.

I tried with java code which could only create a queue in webMethods queue and not able to alter already existing queue.

Regards,
Vinodini.

What are you trying to do that leads you to wanting to lock a queue?

Thanks for the response.

There was issue with the production ERP system and the ERP system was down for 30 mins and due to which lot of message processed and tried to reach SAP but failed. So there were lots of messages lost.
So to handle this we have decided to lock the webmethods queue when we have issues to connect to ERP system and unlock the queue when it is able to pig the ERP system. Which wil prevent us from message lost.

Please let me know if there is any other better solution to handle this scenario.

Thanks for the response.

There was issue with the production ERP system and the ERP system was down for 30 mins and due to which lot of message processed and tried to reach SAP but failed. So there were lots of messages lost.
So to handle this we have decided to lock the webmethods queue when we have issues to connect to ERP system and unlock the queue when it is able to pig the ERP system. Which wil prevent us from message lost.

Please let me know if there is any other better solution to handle this scenario.

Two items come to mind.

Use MWS to record audit logs of service instances. This will record the input pipeline so you can resubmit the services as needed.

Suspend the triggers (don’t disable) that are used to send data to ERP. This will hold the events on the Broker. When ERP is back resume the triggers.

Thanks Again.
I will check on the MWS record audit log.

Is it possible to achieve suspend/resume queues using java code?

Probably. You could also do a FLOW service to call the appropriate service to suspend the triggers.

But the easiest thing to do is use Administrator to suspend them.

Thanks alot for the response

Can you please brief the below point
“But the easiest thing to do is use Administrator to suspend them.”

Review the IS Administrator’s Guide for how to suspend triggers.

I could suspend and resume the triggers using the below servcies by providing the trigger names
Pub.trigger.suspendProcessing, Pub.trigger.resumeProcessing.

Thanks alot for your help.

Another option is to configure the trigger to suspend when the trigger service throws an exception.