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 » Fire Flow When All Messages in MQ are Processed (MQ Empty)

Post new topic  Reply to topic
 Fire Flow When All Messages in MQ are Processed (MQ Empty) « View previous topic :: View next topic » 
Author Message
ReemRashwan
PostPosted: Mon Aug 23, 2021 5:11 am    Post subject: Fire Flow When All Messages in MQ are Processed (MQ Empty) Reply with quote

Novice

Joined: 09 Mar 2021
Posts: 12

TL;DR I need to monitor a queue when its empty after being filled with messages, how can I do that.

Understanding The Application


Hi, I have the following flows in my application
Flow 1: HTTP Input -> some nodes -> HTTP Request (get list of data from other system) -> Compute Node (to split data list into one message at a time) -> MQ Output Node (Name: APPIN)

Flow 2: MQ Input (APPIN) -> some heavy processing -> send data to other system.

Flow 3: HTTP Input -> Nodes to collect some statistics from other systems that is dependent on flow 2 output.

I have a cron job that starts the application using http node in flow 1. Flow 2 may take one or two hours dependening on incoming data from other systems even with multithreading. Flow 3 is called on demand whenever statistics are required

The Question

How can I monitor my queue when its done processing all message that came from other systems, say I have 2000 messages, I need to fire flow 3 only when all of these messages are processed (either succeeded or failed after retries). Any ideas?
Back to top
View user's profile Send private message
abhi_thri
PostPosted: Tue Aug 24, 2021 1:18 am    Post subject: Re: Fire Flow When All Messages in MQ are Processed (MQ Empt Reply with quote

Knight

Joined: 17 Jul 2017
Posts: 516
Location: UK

hi...
ReemRashwan wrote:
Flow 2 may take one or two hours dependening on incoming data from other systems even with multithreading.

May be worth looking at below links to see whether it could improve the throughput,
https://www.ibm.com/docs/en/integration-bus/10.0?topic=performance-esql-code-tips
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiWoOzhpMnyAhWE_6QKHWjDDSAQFnoECBIQAQ&url=https%3A%2F%2Fshare.confex.com%2Fshare%2F124%2Fwebprogram%2FHandout%2FSession17043%2FThe%2520Dos%2520and%2520Donts%2520of%2520IBM%2520Integration%2520Bus%2520Performance%2520-%2520Wed%2520040315%2520315pm.pdf&usg=AOvVaw1cCl3vGkOWB1I58nVG3WS5

ReemRashwan wrote:
How can I monitor my queue when its done processing all message that came from other systems, say I have 2000 messages, I need to fire flow 3 only when all of these messages are processed (either succeeded or failed after retries). Any ideas?


If you are just after statistics why should it matter to wait for the queues to be empty at all? How about just running the stats every hour or so, that should tell you what exactly is going on including the busy time stats.

If you really want to run the stats only when the queue is empty add an additional current depth check before starting the stats job.
Back to top
View user's profile Send private message
ReemRashwan
PostPosted: Thu Aug 26, 2021 5:38 am    Post subject: Re: Fire Flow When All Messages in MQ are Processed (MQ Empt Reply with quote

Novice

Joined: 09 Mar 2021
Posts: 12

abhi_thri wrote:
hi...

May be worth looking at below links to see whether it could improve the throughput,
https://www.ibm.com/docs/en/integration-bus/10.0?topic=performance-esql-code-tips
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiWoOzhpMnyAhWE_6QKHWjDDSAQFnoECBIQAQ&url=https%3A%2F%2Fshare.confex.com%2Fshare%2F124%2Fwebprogram%2FHandout%2FSession17043%2FThe%2520Dos%2520and%2520Donts%2520of%2520IBM%2520Integration%2520Bus%2520Performance%2520-%2520Wed%2520040315%2520315pm.pdf&usg=AOvVaw1cCl3vGkOWB1I58nVG3WS5



Thank you for poining out to these resources.

abhi_thri wrote:
If you are just after statistics why should it matter to wait for the queues to be empty at all? How about just running the stats every hour or so, that should tell you what exactly is going on including the busy time stats.


Will this seems logical, but the end system that displays statistics doesn't show how many messages in general that should have been processed.
Example: if I have 2000 messages and they take 2 hours, the statistics flow will return: 50 messages have failed and 950 have succeeded, but it will know nothing about the other 1000, I think that is kinda misleading in my case since the statistics flow is meant to run only at the end of operation. Am I missing something?

abhi_thri wrote:
If you really want to run the stats only when the queue is empty add an additional current depth check before starting the stats job.

How can I check that from IIB? I am thinking of a MQGet node with browse only option checked, and with the No Message Terminal is connected to the stats flow.
Maybe a loop in another flow that keeps calling the MQGet node say every 10 minutes?
Back to top
View user's profile Send private message
timber
PostPosted: Mon Aug 30, 2021 12:49 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

I'm confused. You said:
Quote:
Flow 3 is called on demand whenever statistics are required
but then you also said:
Quote:
I need to fire flow 3 only when all of these messages are processed

So when can Flow 3 be called?
a) once, but only after Flow 2 has completed
b) multiple times, but only after Flow 2 has completed
c) any time, regardless of whether Flow 2 has completed
Back to top
View user's profile Send private message
ReemRashwan
PostPosted: Tue Aug 31, 2021 12:48 am    Post subject: Reply with quote

Novice

Joined: 09 Mar 2021
Posts: 12

timber wrote:

So when can Flow 3 be called?
a) once, but only after Flow 2 has completed
b) multiple times, but only after Flow 2 has completed
c) any time, regardless of whether Flow 2 has completed


Sorry for misconfusion.
It's "b": ( multiple times, but only after Flow 2 has completed). This happens in a daily basis. If flow 2 runs everyday at 1 am and finishes at 2 am, I can run flow 3 anytime that day after 2 am, but I don't want flow 3 to start for example at 12:30 (before flow 2) or 1:30 am (in the middle of flow), and the faster I run flow 3 after flow 2 completion is better.
Back to top
View user's profile Send private message
timber
PostPosted: Tue Aug 31, 2021 5:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

It sounds as if you really need 4 flows, not 3.
- Flow 1: HTTP -> MQ
- Flow 2: MQ -> [other system(s)]
- Flow 3a: Runs immediately after Flow2. Collects statistics data and writes to a database.
- Flow 3b: API that provides read-only access to the most recent Flow2 statistics.

The key design challenge is how to detect that Flow2 has 'finished'. I think you are intending to use 'APPIN queue empty' as the trigger for this. I would kick off a monitoring flow in Flow 1, and automatically trigger Flow 3a (collect statistics) when APPIN queue has been empty for 2 minutes.
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 » Fire Flow When All Messages in MQ are Processed (MQ 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.