Author |
Message
|
santy |
Posted: Fri Jul 24, 2009 10:24 am Post subject: To check queue is created or not through ESQL |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
Hi,
I'm working on WMB 6.0 and 6.1.
Can you please tell me that is there any way that I can check through ESQL , whether queue is created or not before writing the message to output queue from MQOutput Node ?
Thanks. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 24, 2009 10:39 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
There is no way directly.
However you could:-
1)Add a try catch node before the MQoutput Node
2)Attempt to write to the Queue
3) Catch the error and after traversing the tree, check for Object-Not-Found
4) Carry on.
If no error occurs then the queue exists.
Buy I'm puzzled. Why would you want to do this? Are you using Dynamic Queues or there is some other reason for wanting to do this?
Remember, you can't check for or handle every possible infrastructure error in every flow. Sometimes, you have to assume that the infrastructure is there and working.
If is not then the whole system is in deep do-do already. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
santy |
Posted: Fri Jul 24, 2009 10:46 am Post subject: |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
Hi, I wanted to do this because we are doing some Database commit operations after sending the messages to output queue, and we don't want to rely on default message flow commit operations.
Now if the queue does not present, we do not want to commit that DB operations.
So I wanted to check whether through ESQL we can check/catch whether the queue is present or not. |
|
Back to top |
|
 |
zpat |
Posted: Fri Jul 24, 2009 10:53 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
This sounds like a confused design.
Are you going to be coding queue names in ESQL - very bad idea!
The fact that this feature does not exist in WMB tells you that you do not need it.
If the queue name is in the MQoutput node property then simple procedural checks before deployment are enough.
After all you do test everything you deploy - don't you? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jul 24, 2009 10:54 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
By default, if you get ANY WMQ error you will throw an exception.
If you have not added any TryCatch nodes to the path of the message through the flow before the MQOutput Node, it will roll back to the MQInput (or other node) at the start of the flow. If you don't have anything connected to the Error or Failure terminal what do you think happens to your DB Commits? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 27, 2009 5:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
santy wrote: |
Now if the queue does not present, we do not want to commit that DB operations. |
It's not a really good idea to write code to deal with administative problems. You're better off writing some procedures and QA to ensure these objects are present. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Mon Jul 27, 2009 5:48 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
smdavies99 wrote: |
If you have not added any TryCatch nodes to the path of the message through the flow before the MQOutput Node, it will roll back to the MQInput (or other node) at the start of the flow. If you don't have anything connected to the Error or Failure terminal what do you think happens to your DB Commits? |
My thoughts exactly!
Be sure to read about the "transaction" mode property on the node that updates the DB and what the different settings mean to the transaction. |
|
Back to top |
|
 |
|