Author |
Message
|
pkdec |
Posted: Thu Oct 12, 2023 9:19 am Post subject: Override MQGet queuename property in while loop |
|
|
 Acolyte
Joined: 12 Feb 2015 Posts: 66 Location: Canada, QC
|
Hello All,
I have to override MQGet node Queue name property in while loop for each message.
I am geting exceptions can you please tell me how to go ahead.
Here is the existing code which I need to work with
WHILE ALLMessageRead=FALSE and curQdepth >0 and Index<batchsize DO
PROPAGATE to TERMINAL 'out' ;
END WHILE
with below approach I was trying and propagated to out, it did not work.
SET OutputLocalEnvironement.MQ.GET.QueueName = queueName;
queueName I provide using external variable UDP.
lets say there are 4 message to loop through which means it needs to send one by one all to one queue.
it only propagate 1 message to the overridden queue and next propagate it gives an exception "failed to open queue"
Failed to open queue is dummy queue I have provided in MQGet node property.
the outlocalenvironment is geting swipped off when it comes back to propagate next message.
what is solution to make sure all 4 message is commited to downstream queue?
Thanks
PK
Last edited by pkdec on Thu Oct 12, 2023 11:37 am; edited 1 time in total |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Oct 12, 2023 9:39 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
It did not work is not precise. What exception(s) were thrown? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
pkdec |
Posted: Thu Oct 12, 2023 10:05 am Post subject: |
|
|
 Acolyte
Joined: 12 Feb 2015 Posts: 66 Location: Canada, QC
|
bruce2359 wrote: |
It did not work is not precise. What exception(s) were thrown? |
Thank you for your reply.
I have edited my post.
Thanks
PK |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Oct 12, 2023 3:46 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
No need to look at queue depth, as MQ internals will return r/c 2033 NO_MSG_AVAILABLE at next Get call when there are no messages in the input queue. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
pkdec |
Posted: Fri Oct 13, 2023 6:03 am Post subject: |
|
|
 Acolyte
Joined: 12 Feb 2015 Posts: 66 Location: Canada, QC
|
bruce2359 wrote: |
No need to look at queue depth, as MQ internals will return r/c 2033 NO_MSG_AVAILABLE at next Get call when there are no messages in the input queue. |
you are not geting my question my target queue should have 4 message when source wants to propagate 4 from its source.
it is only propagating 1 message and 3 remains in source queue.
which means while propagation the destination queue which I have overriden is
reseted to node property which is a dummy value(dummy queue name)
obviously it will says can not open queue in the exception header.
not sure why you answered me with mqrc code 2033
thanks
PK |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Oct 13, 2023 9:03 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
pkdec wrote: |
... lets say there are 4 message to loop through which means it needs to send one by one all to one queue. |
Will this app only and always deal with 4 messages? If more/less, will you need to modify your app to know how many messages? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Oct 13, 2023 3:08 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to overwrite the local environment variable for each message!  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Oct 16, 2023 6:47 am Post subject: Re: Override MQGet queuename property in while loop |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
pkdec wrote: |
WHILE ALLMessageRead=FALSE and curQdepth >0 and Index<batchsize DO
|
Why are you looking at curQdepth? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
pkdec |
Posted: Wed Oct 18, 2023 7:59 am Post subject: |
|
|
 Acolyte
Joined: 12 Feb 2015 Posts: 66 Location: Canada, QC
|
fjb_saper wrote: |
You need to overwrite the local environment variable for each message!  |
Thank you, it worked I overrided for each message local Environment variable. |
|
Back to top |
|
 |
|