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 » Trigger a flow when a queue is empty

Post new topic  Reply to topic
 Trigger a flow when a queue is empty « View previous topic :: View next topic » 
Author Message
me.mehta
PostPosted: Mon Sep 05, 2011 3:39 am    Post subject: Trigger a flow when a queue is empty Reply with quote

Novice

Joined: 30 Dec 2010
Posts: 11

Hi All,

I just want to know if there any way I can trigger a message flow when a queue being consumed by another flow becomes empty?

Thanks,
Me
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Sep 05, 2011 4:57 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

This is a somewhat strange design. First of all you would need to be sure that you only checked this queue after all the messages had been delivered to it. Queues momentarily will have depth zero as messages arrive and are processed (MQ group processing can help this issue).

Essentially you are trying to communicate between two flows. If the first flow knows when it has processed the last message, it could place a message on another queue which starts your second message flow.

If the first flow examines the queue depth of its own input queue - it could detect when it had the last message. However if might have to decide if this was an appropriate time to look (maybe check a database flag).

The MQINQ API call is the MQ way to do enquire on queue values.

Unfortunately WMB does not expose this in a node. You could use a MQGET node with browse to detect when a RC 2033 (empty queue) is found (inside the first flow).

This sort of design tends to be fragile and incompatible with multi-threading.

Using a collector node might provide a more elegant solution.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 05, 2011 8:59 am    Post subject: Reply with quote

Grand High Poobah

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

why do you need to start a different message flow? Are we talking here about processing 2 different messages in sequence? Is there message affinity? Is there any way to determine which is the second message to be processed?

In the most simple terms, what you are asking for makes little sense.
If talking about the same message, you should just "chain" the 2 message flows... (output of one flow is the input of the other)...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Sep 06, 2011 4:39 am    Post subject: Re: Trigger a flow when a queue is empty Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

me.mehta wrote:
I just want to know if there any way I can trigger a message flow when a queue being consumed by another flow becomes empty?


I echo the comments of my associates - this is a very strange design if only because the definition of "empty" is fluid. If the depth of a queue is zero, that just means another message hasn't arrived yet. Assuming one likely scenario, that App A drops n messages onto a queue, Flow A processes them then Flow B does something with the processed messages, the queue depth hitting zero doesn't mean Flow A is finished. It just means all the messages currently delivered have been processed. There could be any number stuck in a transmission queue waiting for the network to come back up.

Your best solution is to redesign such that each message is processed on arrival by both flows. If that's impossible, I'd go with my worthy associate's idea of the Collector node.

If you're determined to stick with this rather odd design, if you are certain Flow A processes all messages on arrival and never takes more than x seconds to process all the messages you could possibly use a queue service event to trigger Flow B x+y seconds after the last message is placed on the input queue where y is the length of time you wait to pick up straggler messages.

It won't handle the scenario of the network failure I talk about above, and is going to be a contact admin piece of coding with a lot of potential failure points.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Trigger a flow when a queue is empty
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.