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 » Flow Design Assistance

Post new topic  Reply to topic
 Flow Design Assistance « View previous topic :: View next topic » 
Author Message
mc01285
PostPosted: Fri Aug 13, 2010 11:33 am    Post subject: Flow Design Assistance Reply with quote

Novice

Joined: 11 May 2009
Posts: 11

I have messages coming in on a MQ queue that need to update a database.

I only want to process the messages if the database is available. If the database is not available I want to somehow delay the processing for a period of time and then retry.

Anybody have design pattern?


Thanks for the help!
Mark
Back to top
View user's profile Send private message
Gaya3
PostPosted: Fri Aug 13, 2010 11:40 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

couple of questions to be cleared

1. Whats the Volume?
2. Do you want a delta load or full load?

Design 1.
1. Get the message from MQ
2. Try Connecting to Database
2.1. If not available, try for another 3[keep this threshold as minimum] times again, if it is still not available, keep your message in another queue and throw an error desc. trigger it after 5 mins[Keep this threshold depends upon your business criteria, but keep it as long as you could, as keep on trying DB is not a good idea] do the same process, if it is failing, throw an error
with proper desc
2.2. if is available, insert the data to database.

Well all depends upon the volume again
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 13, 2010 11:40 am    Post subject: Reply with quote

Jedi Knight

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

I wouldn't do what you are trying to accomplish, but if I would...

Use transactionality, and in the unhappy path, put some code (maybe using a JCN) to get disable the queue and/or stop the message flow.

You could have another flow that periodically checks the status of the database and re-enable the first flow/queue when database comes available.

Ultimately you are trying to use Broker to manage operational status of infrastructure componetry and there are much better ways/tools to do this. WebSphere Business Monitor is one. Tivoli Omeggamon is another. BMC Patrol is a third.

Good luck.
_________________
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
inMo
PostPosted: Fri Aug 13, 2010 11:58 am    Post subject: Reply with quote

Master

Joined: 27 Jun 2009
Posts: 216
Location: NY

Just to join the party ... If you go so far as to have the periodic flow check database availability & start 2nd flow if available, why not also do the flip, have it shutdown 2nd flow if not available.

Another technique ... perhaps put the flow to sleep for a few seconds, then cause your error, rollback. Ensure your queue settings allow for reprocessing (I think it is backout threshold needs to be higher then 1). The flow will automatically pickup the message and retry the logic (DB interaction).
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Aug 13, 2010 12:22 pm    Post subject: Reply with quote

Jedi Knight

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

I saw a guy try to change the oil in his car with a hammer once.

My dad used to tell me: choose the right tool for the job.

Toolman Tim Taylor from Home Improvement always got bested by his co-hort, Al.

I would encourage you to take a holistic view of the world, and implement a strategic solution that manages database state and application state the right way.

My favorite always was HP OpenView which is now HP Operations Manager software. If you have money, you could buy Tivoli.

If you have no money, you could try JMX tooling that is a standard part of all JREs.
_________________
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
AkankshA
PostPosted: Sun Aug 15, 2010 8:09 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

Also note that all these solutions provided will take away the sequencing of messages...


hence specify all the requirements you have and must need .. to get the viable option
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
lancelotlinc
PostPosted: Mon Aug 16, 2010 6:02 am    Post subject: Reply with quote

Jedi Knight

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

@ AkankshA

Good morning.

AkankshA said:
Quote:

all these solutions provided will take away the sequencing of messages


What do you mean by this?

The solution I suggested does not loose messages and the sequence of messages is maintained.

In further discussion, I recommended a choice of proper tools to accomplish the task specified (managing application and database state).

Trying to manage application state and database state in a broker flow is mis-use of the broker flow.

What do you mean in your statement?
_________________
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
SAFraser
PostPosted: Mon Aug 16, 2010 1:40 pm    Post subject: Reply with quote

Shaman

Joined: 22 Oct 2003
Posts: 742
Location: Austin, Texas, USA

I don't see how a "proper" monitoring tool helps this fellow with handling the exception-type situation when a DB is down. It may help everyone to know that the DB needs attention, but it doesn't help with the immediate issue of what to do with his incoming messages.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Aug 16, 2010 3:17 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

SAFraser wrote:
I don't see how a "proper" monitoring tool helps this fellow with handling the exception-type situation when a DB is down. It may help everyone to know that the DB needs attention, but it doesn't help with the immediate issue of what to do with his incoming messages.


A proper monitoring tool could issue a command to stop the flow when the database is known to be down.

Of course, a proper scheduling tool could do that just as easily.
Back to top
View user's profile Send private message
SAFraser
PostPosted: Tue Aug 17, 2010 4:15 am    Post subject: Reply with quote

Shaman

Joined: 22 Oct 2003
Posts: 742
Location: Austin, Texas, USA

I use a proper monitoring tool. It won't stop a flow "right out of the box". I can script it for such, to be sure. But it's a monitoring tool. It's purpose is to monitor.

A scheduling tool would be a better choice.

But perhaps the OP is not the guy who gets to decide what they buy. I don't get to decide what we get to buy. I can say my opinion, but I don't sign the checks.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 17, 2010 4:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

SAFraser wrote:
I use a proper monitoring tool. It won't stop a flow "right out of the box". I can script it for such, to be sure. But it's a monitoring tool. It's purpose is to monitor.

A scheduling tool would be a better choice.

But perhaps the OP is not the guy who gets to decide what they buy. I don't get to decide what we get to buy. I can say my opinion, but I don't sign the checks.




Without going to far afield, though, I expect slightly more out of my monitoring tools than JUST monitoring. As you said, it could LET SOMEONE KNOW. So, Monitoring plus Alerting. But Alerting is really Taking An Action in response to a condition.

Whether that action is as simple as 'send a page' or more elaborate like 'run a script' is a difference of extent and not of kind. It's still taking an action.

But I don't think this particular situation calls for action at this level. Unless the database is known to be turned off on a given interval or known to be disabled for a long period of time.

For transient issues, either normal MQ rollback and reprocessing is appropriate, or something perhaps involving the Timeout nodes or ESQL SLEEP if it's available.
Back to top
View user's profile Send private message
mc01285
PostPosted: Tue Aug 17, 2010 5:20 am    Post subject: Reply with quote

Novice

Joined: 11 May 2009
Posts: 11

Thanks for the great posts/discusssion!

I'm leaning toward going with "get inihibit"ing the queue with a JCN and then creating TimeNotification flow that would check the database and turn the queue back on using the same JCN class.
Back to top
View user's profile Send private message
Amitha
PostPosted: Tue Aug 17, 2010 6:53 am    Post subject: Reply with quote

Voyager

Joined: 20 Nov 2009
Posts: 80
Location: Newyork

If you consider start/stop message flow approach you can consider using the support pack IO04:

http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24027297&loc=en_US&cs=utf-8&lang=en
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Flow Design Assistance
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.