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 » MQ batch process

Post new topic  Reply to topic Goto page 1, 2  Next
 MQ batch process « View previous topic :: View next topic » 
Author Message
prasannanb
PostPosted: Sun Nov 27, 2011 12:34 am    Post subject: MQ batch process Reply with quote

Apprentice

Joined: 17 Apr 2009
Posts: 35

Hi,

I have a requirement where have to process all the messages in the queue every 30 min(batch process).
How can I achieve this in MB?

If i use,

Timeout Notification -> MQGet -> Compute

This will process only one message every 30 min.

What is the alternative approach?


Thanks
Back to top
View user's profile Send private message
zpat
PostPosted: Sun Nov 27, 2011 3:17 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Use WMQ and WMB as intended, as an event driven stateless messaging system?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Nov 27, 2011 4:07 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

zpat wrote:
Use WMQ and WMB as intended, as an event driven stateless messaging system?


Get out of bed the wrong side this morning?
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sun Nov 27, 2011 3:09 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There are several bad ways to solve this problem.

You can have the timeoutnotification flow do something to "enable" the queue for real processing from a real MQInput node.

You can write a loop over the MQGet node using additional compute or JavaCompute nodes.

You can use a collection that is only complete at 30 minute intervals.

The only good way to solve this problem is to avoid it by processing all of the messages as they arrive, rather than in a batch.
Back to top
View user's profile Send private message
ydsk
PostPosted: Sun Nov 27, 2011 9:24 pm    Post subject: Reply with quote

Chevalier

Joined: 23 May 2005
Posts: 410

If only IBM can provide a polling interval on the MQInput node , just like they did for the FileInput and other nodes This would be an option for all batch processing scenarios.

Another way, similar to the timer notification method listed above is to use a cron tab entry in unix to drop a message on a queue every 30 minutes so it kicks off a msgflow.

Looping around the MQGet node would be an interesting option.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Nov 28, 2011 1:45 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Looping around the MQGet node does present a nice set of potential pitfalls. Things like Units of Work and transactionality springto mind. There are others.

Enjoy
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
vmcgloin
PostPosted: Mon Nov 28, 2011 2:37 am    Post subject: Reply with quote

Knight

Joined: 04 Apr 2002
Posts: 560
Location: Scotland

Why? What is the requirement? What is the outcome of the processing? Why can't you process the messages as they arrive and have the output consumed by a batch job if that really is a business requirement? How many messages are in your half-hourly batch, and what other non-functional requirements do you have?
Back to top
View user's profile Send private message
prasannanb
PostPosted: Mon Nov 28, 2011 11:18 pm    Post subject: Reply with quote

Apprentice

Joined: 17 Apr 2009
Posts: 35

vmcgloin wrote:
Why? What is the requirement? What is the outcome of the processing? Why can't you process the messages as they arrive and have the output consumed by a batch job if that really is a business requirement? How many messages are in your half-hourly batch, and what other non-functional requirements do you have?


My requirement is to re-process all the failed messages which will be there in the queue. This should be retried every 30 min. This is the business requirement.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 29, 2011 5:32 am    Post subject: Reply with quote

Grand High Poobah

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

prasannanb wrote:
vmcgloin wrote:
Why? What is the requirement? What is the outcome of the processing? Why can't you process the messages as they arrive and have the output consumed by a batch job if that really is a business requirement? How many messages are in your half-hourly batch, and what other non-functional requirements do you have?


My requirement is to re-process all the failed messages which will be there in the queue. This should be retried every 30 min. This is the business requirement.


Use a cron job to move all the messages from the failed queue back into the original queue every 30 minutes.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
McueMart
PostPosted: Tue Nov 29, 2011 5:53 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

I had a similar requirement whereby I needed to process messages after they had been on a queue for X amount of time (for retry purposes).

The approach I ended up was is:


Hopefully the flow is quite self explanatory, but in brief:

RetryFlowTick: Set to Controlled operation. Invoke it initially however you want!

ForEachMessageOnRetryQ: Basically a FOR loop with a PROPAGATE in it. The loop will loop a maximum number of times to prevent hitting MQRC_SYNCPOINT_LIMIT_REACHED errors if you are doing transactional stuff.

GetOffRetryQ: Takes 1 message off the 'retry queue'

SetDestinationQ: Sets up the Destination list to put the message back on the queue it needs to go on (For my case this was encoded in the RFH2 header).

StopFlow: This comes out of the 'No messages' terminal and sets an ENVIRONMENT variable which stops the FOR loop in the ForEachMessageOnRetryQ from continuing.

SetupReinvoke: Sets up the necessary message to reinvoke this flow in X seconds.

This might not do exactly what you want as it is, but hopefully it gives you some ideas!
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 29, 2011 5:57 am    Post subject: Reply with quote

Grand High Poobah

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

The usual warnings apply about using the timer nodes in restart situations.

As well as the warnings about repeatedly using an MQGet node in a flow.

I'm also interested to know how the ESQL node knows how many times to loop. Is it actually finding the depth, or just looping <syncpoint limit> times and relying on the 2033 to trigger the StopFlow node? If so, what happens if there are more messages on the retry queue than will fit in a unit of work?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Nov 29, 2011 6:28 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

It is always a bad idea to use WMB as a system administration tool for controlling start and stop of processing. WMB is a high speed messaging engine. Use Tivoli Omegamon, cron, MQ triggers or BMC Patrol to start and stop things.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
McueMart
PostPosted: Tue Nov 29, 2011 7:02 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

From my testing, as long as you don't actually 'loop' on a MQGet node (which increases the call stack internally resulting in a stackoverflow ) there are no major issues.

Quote:
I'm also interested to know how the ESQL node knows how many times to loop. Is it actually finding the depth, or just looping <syncpoint limit> times and relying on the 2033 to trigger the StopFlow node


It will stop the loop either by hitting the 2033, or by hitting the <syncpoint limit> (iterate a variable each time through a loop). [/quote]
Back to top
View user's profile Send private message
Esa
PostPosted: Tue Nov 29, 2011 7:37 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

lancelotlinc wrote:
It is always a bad idea to use WMB as a system administration tool for controlling start and stop of processing. WMB is a high speed messaging engine. Use Tivoli Omegamon, cron, MQ triggers or BMC Patrol to start and stop things.


I recall from my days as a Message Broker course instructor that the timeout nodes were added so that you have all control in one application - Message Broker - instead of spreading it in external tools, like cron. That's what the course material said.

As an ex course instructor I naturally don't put much weight on what the course materials say, but in this case it is consistent with this quote from http://www.ibm.com/developerworks/websphere/library/techarticles/0603_schutz/0603_schutz.html:

Quote:
To make a flow run hourly on the hour, you can use a UNIX cron job, which can provide rich semantics to control job scheduling. The job would presumably use a utility such as amqsput to send a (dummy) message to the input queue of the message flow that you want to run.

While this approach works, it adds complexity to the system compared to using timer nodes. You must co-ordinate the creation of the cron job with the deployment of the message flows. If many flows have this requirement, maintenance of the crontab becomes burdensome. Another point of failure is introduced into the system, and you must have a mechanism to ensure that the amqsput utility actually worked and didn't generate a bad return code such as 2035. This approach makes problem determination more complex.

Using timeout nodes provides a flexible, self-contained mechanism to start a message flow. No external coordination with the broker is required beyond what is normally required to deploy a flow. You can use built-in, broker-native tracing mechanisms to detect the failure to set the timers. Although cron is usually available on UNIX, not all installations have it, and other platforms such as Windows® and z/OS® have different job scheduling mechanisms. Timeout nodes provide a consistent mechanism across all WebSphere Message Broker V6 platforms.



I agree that timeout nodes perhaps should not be used for restarting things, but why not for starting and stopping flows at specific times?
I must have missed some discussion. You are in fact saying that TimeoutControl node should not be used at all and TimeoutNotification should only be used for implementing delay in processing?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Nov 29, 2011 9:03 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Would rather use the other stated options for controlling jobs. WMB is a high speed messaging engine. I know I seem to be repeating myself. Why bog down your Supersonic Jet with strap on model T engine parts?
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MQ batch process
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.