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 » Getting Curdepth from MQMD header

Post new topic  Reply to topic
 Getting Curdepth from MQMD header « View previous topic :: View next topic » 
Author Message
sahas
PostPosted: Thu Jan 03, 2008 6:51 am    Post subject: Getting Curdepth from MQMD header Reply with quote

Newbie

Joined: 11 Apr 2006
Posts: 4

Hi,

There are 10 messages in the local queue. I want to get the Curdepth of the queue using ESQL.

Can I get the curdepth attribute in the MQMD header. If not anyone help me in this regard as to how to get the curdepth using ESQL?

Thanks and Regards,
Srikanth.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jan 03, 2008 6:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Nope.

You can't do this, and... you don't want to.

It's a really bad idea, almost certainly.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jan 03, 2008 7:05 am    Post subject: Reply with quote

Grand High Poobah

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

You would need to send a PCF message requesting the curdepth attribute.
Be aware however that the reply to message may not be unique...

Could you elaborate as to why you need this attribute???

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sahas
PostPosted: Thu Jan 03, 2008 7:14 am    Post subject: Reply with quote

Newbie

Joined: 11 Apr 2006
Posts: 4

We are going for a retry mechanism. We are using MQ Get node to retrieve the message from a queue. But MQ Get node is getting only the first message. Before MQ Get node We are using TimeOutControl Node and gave some 30 min. Fo every 30 min the MQGet node will pick up the first message from the queue. Within 30 min there could be many other messages sitting on the queue. So, If only the first message is picked up from the queue then the rest of the messages will be on the queue itself and wait for very long time for their turn.

In order to resolve this problem, we want to get the curdepth of the queue for every 30 min and loop the flow to process all the messages.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Jan 03, 2008 7:49 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Couldn't you just use a message flow that processed all of the messages all of the time?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fschofer
PostPosted: Thu Jan 03, 2008 7:58 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi,

you can simply loop the MQGet node + some procesing within the flow until it sends something out to the 'no message' terminal.

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Jan 03, 2008 7:59 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Just loop until the MQGet exits out the "no more messages" terminal.

I.e. until it returns the equivalent of a 2033.

Upstream of MQGet, put an esql that does something like
while sharedVariableFlagForNoMoreMessages is false
propagate to MQGet
end while

and attach a compute node to MQGet no more messages terminal that sets sharedVariableFlagForNoMoreMessages to false.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sahas
PostPosted: Thu Jan 03, 2008 8:08 am    Post subject: Reply with quote

Newbie

Joined: 11 Apr 2006
Posts: 4

Thanks everyone.
I will try this logic but I am having a doubt here. Once the message is taken from the queue it will be processed and if it got failed again then it will come to the same queue and where the flow is still looping and get this message again. So, I feel it may go into continuous loop. But anyway I will check and update you regarding this.

Thanks and Regards,
Srikanth.
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Fri Jan 04, 2008 3:02 am    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

That is what backout queues and backout count are there for, so if you roll back a poison message more than "n" times, you push it over the the backout queue.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Jan 04, 2008 4:47 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

You don't need to use PCF to enquire on queue attributes including current depth.

You can simply open a queue for inquire and use the MQINQ call.

Application programs are not really meant to use system management functions like PCF.

Not sure if WMB implements MQINQ and I can't really see why it would be needed. As stated above look at the MQMD.Backout value.

However MQINQ is useful to extract the backout requeue count threshold and backout re-queue queue name if you want to do the thing by the book.
Back to top
View user's profile Send private message
sunny_30
PostPosted: Mon Jan 07, 2008 5:13 pm    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

Sahas,

You can write an external Java function that enquires a Queue for depth.

eg:
int openOptions = MQC.MQOO_INQUIRE ;
que = qMgr.accessQueue(qname, openOptions);
curDepth = que.getCurrentDepth();

The java function can later be called from ESQL like below:

CREATE FUNCTION QueueDepth(IN qmanager CHAR, IN queue CHAR) RETURNS INTEGER
LANGUAGE JAVA
EXTERNAL NAME "QueueDepth.getQueueDepth";

-Sunny
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 08, 2008 7:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

sunny_30 wrote:
You can write an external Java function that enquires a Queue for depth.


But that's a really bad idea.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
sunny_30
PostPosted: Tue Jan 08, 2008 12:55 pm    Post subject: Reply with quote

Master

Joined: 03 Oct 2005
Posts: 258

Jeff,
Is enquiring a queue for the curdepth a bad-idea? OR
Is writing an External Java procedure to do that a bad idea?

Will there be any problems if Java procedures are called from ESQL?

-Sunny
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jan 08, 2008 1:05 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It's a bad idea to make any business application decisions based on queue depth.

It's a bad idea.. in general... to do anything with MQ from Java in broker, unless you're very very careful, as you might interefer with the Broker's normal MQ operations - either by messing up the connection, or by interfering with the transaction or etc. etc.
_________________
I am *not* the model of the modern major general.
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 » Getting Curdepth from MQMD header
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.