Author |
Message
|
nthepak |
Posted: Thu Nov 20, 2008 1:43 am Post subject: Dynamically setting the Queue name for MqGet node |
|
|
 Voyager
Joined: 19 Dec 2005 Posts: 79 Location: India
|
Hi All,
We have a requirement wherein we have get the messages from a queue which is to be dynamically resolved during the runtime based on a record from the database.
I believe we cant dynamically set the queueName on the MqGet node, but we have to either use MqApi's to get the message from the corresponding queue in a JCN node or have to manage having multiple MqGet nodes in the flow for each of the queues (if they are fixed!)
I would like to know from you guys if there is any other practical method to achieve this. If not, then I guess java implementation is the only way out and it would be great if anyone can suggest me of a java implementation as i am not very good at it  _________________ BR,
Deepak N |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 20, 2008 1:56 am Post subject: Re: Dynamically setting the Queue name for MqGet node |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nthepak wrote: |
We have a requirement wherein we have get the messages from a queue which is to be dynamically resolved during the runtime based on a record from the database.
|
How dynamic? Can it be set at deploy time via a UDP, i.e. is it valid for the life of the flow? If not, why does it so variable? What is the connection to the database, i.e. why is it holding MQ configuration info?
A little more about the design please. It sounds suspiciously like you've accidently created a stick to beat yourself with; there may be a different solution. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nthepak |
Posted: Thu Nov 20, 2008 2:10 am Post subject: |
|
|
 Voyager
Joined: 19 Dec 2005 Posts: 79 Location: India
|
Hi,
Let me put it this way...
The source queue from where i have to fetch the messages is an intermediate queue in a flow and in that flow we ourselves would have put the message in an earlier compute node with saving the MsgId.
Then for a particular condition in the flow there after, we have to pick up the message from the same queue based on that MsgId that i have already stored and store it as a backup in the database.
Since the queue name is fetched from the database, it is resolved during the flow runtime as to which queue the message is put and thats not a problem since we have the option for doing that in a MqOutput Node, but while picking the same message from the same queue i cant do it during the runtime as we should have hardcoded the queueName value in the MqGet node by this time.
I hope i am clear this time  _________________ BR,
Deepak N |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 20, 2008 2:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Gosh.
So if I understand correctly,you put a message to a queue & store the MsgId and queue name in a database for later use. When the conditions are right, you retrieve the queue name & MsgId from the database, which you then need to feed to an MQGet node to retrieve the required message.
Now you will please correct any of the above in which I'm mistaken? But assuming I'm correct, please also tell me why you don't dump not the queue name & MsgId but the entire message content into the database for later use? If you're reading the queue name & MsgId back under your current design you could certainly reconstruct the original message without difficulty and that would avoid this entire dance with the MQGet node. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
nthepak |
Posted: Thu Nov 20, 2008 8:52 pm Post subject: |
|
|
 Voyager
Joined: 19 Dec 2005 Posts: 79 Location: India
|
Hi,
The queue is meant to contain pdf message content fed to a printer for printing. So at times, based on the condition of the incoming message header value, the pdf message will either have to stay in the queue or have to be put to the database as a backup.
As per my understanding, what i see from you is that i can solve this by first having the message in the database and then later deciding it whether it has to goto the target database table or to the queue, by using an temporary table in the database for this storage.
However, the design is restricted to avoid using of the database table all the time to store the BLOB messages. Unfortunately, this is not recommended by my peers and i still have to know the reason for that  _________________ BR,
Deepak N |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 21, 2008 12:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What part of the documentation for the MQGet node tells you that you can't set the queue name dynamically at runtime? |
|
Back to top |
|
 |
nthepak |
Posted: Fri Nov 21, 2008 12:58 am Post subject: |
|
|
 Voyager
Joined: 19 Dec 2005 Posts: 79 Location: India
|
I searched through the MqGet node properties to find the options which could allow me to set dynamically but i couldn't find anything of that sort.
Please let me know if I am missing anything over here. If so, can you please explain how we can dynamically set the queueName in the MqGet node so that if i set the queue in the compute node prior to MqGet node and that gets resolved eventually. _________________ BR,
Deepak N |
|
Back to top |
|
 |
wbi_telecom |
Posted: Fri Nov 21, 2008 7:22 am Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
Take a look at LocalEnvironment structure. that's where you put the Qname dynamically for MQget. The code below is from memory so check for correct syntax.
SET OutputLocalEnvironment.MQ.GET.QueueName= <your Qname>
Cheers, |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Nov 21, 2008 12:17 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
wbi_telecom wrote: |
Take a look at LocalEnvironment structure. that's where you put the Qname dynamically for MQGet. The code below is from memory so check for correct syntax.
SET OutputLocalEnvironment.MQ.GET.QueueName= <your Qname> |
I think this feature is new to WMB 6.1. It might not work for WMB 6.0 or earlier versions.
The MQGet node might still require a valid queue name in its properties, even if it's unused. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 21, 2008 12:22 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
rekarm01 wrote: |
I think this feature is new to WMB 6.1. It might not work for WMB 6.0 or earlier versions. |
What part of the 6.0 and 6.1 documentation makes you think that?
The MQGet node is new as of WMB 6.0, by the way, so it does not exist in earlier releases.
rekarm01 wrote: |
The MQGet node might still require a valid queue name in its properties, even if it's unused. |
That would only be true if the Queue Name property of the node were marked as 'required' - does the documentation indicate that? |
|
Back to top |
|
 |
wraymore |
Posted: Fri Nov 21, 2008 1:09 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
In WMB 6.0, the MQGET Node does require a valid queue be entered for the Queue Name property. However it can be overridden by setting the MQ parameter(s) in the Local Environment in a compute node prior to the MQGET Node. You do have to identify the location of the Input MQ parameters on the Request tab of the MQGET Node.  |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Nov 21, 2008 7:57 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqjeff wrote: |
rekarm01 wrote: |
I think this feature is new to WMB 6.1. It might not work for WMB 6.0 or earlier versions. |
What part of the 6.0 and 6.1 documentation makes you think that? |
This part of the 6.0 documentation made no mention of an overriding "QueueName"; that made me think that it might be new to 6.1.
After some more digging around , I unearthed this, which does mention "${inputMQParmsLocation}.QueueName", but does not explicitly tie it to "LocalEnvironment.MQ.GET".
This part of the 6.1 documentation is a little bit clearer, only because an example ESQL statement was thrown in:
Quote: |
For example, add a Compute node into the flow and define a new queue name for the MQGet node to read for messages, by including the following ESQL statement:
Code: |
SET LocalEnvironment.MQ.GET.QueueName = 'new_queue'; |
Use LocalEnvironment.MQ.GET. as the correlation name for all fields that relate to the MQGet node. |
But even that little addendum has some problems:- The ESQL statement should probably have an "Output" before "LocalEnvironment".
- There's no mention that the "LocalEnvironment.MQ.GET." correlation name might, itself, be overridden in the MQGet Request Properties tab.
mqjeff wrote: |
The MQGet node is new as of WMB 6.0, by the way, so it does not exist in earlier releases. |
... unless you want to count the IA09 supportpac, which dates back to MQSI 2.0.1.
mqjeff wrote: |
rekarm01 wrote: |
The MQGet node might still require a valid queue name in its properties, even if it's unused. |
That would only be true if the Queue Name property of the node were marked as 'required' - does the documentation indicate that? |
Both the 6.0 and 6.1 documentation indicate that this property is mandatory.
My 6.0 toolkit agrees. |
|
Back to top |
|
 |
nthepak |
Posted: Sun Nov 23, 2008 11:30 pm Post subject: |
|
|
 Voyager
Joined: 19 Dec 2005 Posts: 79 Location: India
|
Hi All,
Setting "OutputLocalEnvironment.MQ.GET.QueueName" will work for dynamically setting the queue name in MqGet node.
We can set some dummy queue name in the MqGet node properties tab for QueueName, which will be over-riden by the above ESQL statement in the preceding Compute node.
Thank you all for your inputs  _________________ BR,
Deepak N |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 24, 2008 3:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Check the documentation in 6.0 it says: here
Quote: |
If the location of the parameters for the MQGET call (for example, MQGMO overrides), is not the default location InputLocalEnvironment.MQ.GET, specify the location in Input MQ parameters location. |
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
wraymore |
Posted: Mon Nov 24, 2008 6:27 am Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
Thanks for the clarification.  |
|
Back to top |
|
 |
|