ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Override MQGet queuename property in while loop

Post new topic  Reply to topic
 Override MQGet queuename property in while loop « View previous topic :: View next topic » 
Author Message
pkdec
PostPosted: Thu Oct 12, 2023 9:19 am    Post subject: Override MQGet queuename property in while loop Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Thu Oct 12, 2023 9:39 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
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
View user's profile Send private message
pkdec
PostPosted: Thu Oct 12, 2023 10:05 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Thu Oct 12, 2023 3:46 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
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
View user's profile Send private message
pkdec
PostPosted: Fri Oct 13, 2023 6:03 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Fri Oct 13, 2023 9:03 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
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
View user's profile Send private message
fjb_saper
PostPosted: Fri Oct 13, 2023 3:08 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

You need to overwrite the local environment variable for each message!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Mon Oct 16, 2023 6:47 am    Post subject: Re: Override MQGet queuename property in while loop Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
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
View user's profile Send private message
pkdec
PostPosted: Wed Oct 18, 2023 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Override MQGet queuename property in while loop
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.