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 » Message Flow - Execute on startup only

Post new topic  Reply to topic
 Message Flow - Execute on startup only « View previous topic :: View next topic » 
Author Message
mickey1691
PostPosted: Wed Jul 10, 2013 1:40 am    Post subject: Message Flow - Execute on startup only Reply with quote

Novice

Joined: 04 Jun 2013
Posts: 19

Is there any way to make a message flow run once and only once and only when the app is deployed to the message broker? Thanks
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 10, 2013 3:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Start it with an MQInput node.

Only ever send messages to the MQInput node when you deploy the flow.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jul 10, 2013 4:01 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Moved to Message Broker forum.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Tibor
PostPosted: Wed Jul 10, 2013 4:22 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

If you can explain, why it is important, it is easier to find a solution...
Back to top
View user's profile Send private message
mickey1691
PostPosted: Wed Jul 10, 2013 5:45 am    Post subject: Reply with quote

Novice

Joined: 04 Jun 2013
Posts: 19

A feature of the app we're making includes putting objects from a database into the broker's cache at the start of the application/broker.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed Jul 10, 2013 5:53 am    Post subject: Reply with quote

Jedi Knight

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

mickey1691 wrote:
A feature of the app we're making includes putting objects from a database into the broker's cache at the start of the application/broker.


WMB is a high-speed messaging engine. As such, flows are designed like jet engines: if they stop your in trouble.

Take a different approach.
_________________
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
Tibor
PostPosted: Wed Jul 10, 2013 5:57 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

lancelotlinc wrote:
Take a different approach.

Agreed. I think a more proper way to develope a subflow for initializing your cache.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 10, 2013 6:24 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Tibor wrote:
lancelotlinc wrote:
Take a different approach.

Agreed. I think a more proper way to develope a subflow for initializing your cache.


The problem with this is that it delays the very first message processed after a deploy.

This might be unacceptable.

However, doing the load in a separate flow means that the main flow still has to block if the cache is not loaded. Which could still delay the first message through.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Jul 10, 2013 6:30 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.

you could put the same subflow into all the flows. This would load the cache but include a test to not do anything if the cache was initialised.

This is a pretty generic problem and one that must have been solved already in sites that use it. It would be interesting to hear how they have done this.

The various alternatives would make a nice Redbook/RedPaper

{hint-hint}
_________________
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
lancelotlinc
PostPosted: Wed Jul 10, 2013 6:42 am    Post subject: Reply with quote

Jedi Knight

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

mqjeff wrote:
Tibor wrote:
lancelotlinc wrote:
Take a different approach.

Agreed. I think a more proper way to develope a subflow for initializing your cache.


The problem with this is that it delays the very first message processed after a deploy.

This might be unacceptable.

However, doing the load in a separate flow means that the main flow still has to block if the cache is not loaded. Which could still delay the first message through.


Cache loading generally happens in the constructor of your Singleton object if you have one. This method does not hold up the first message, and the cache gets loaded at startup. Be sure to have ample logging.
_________________
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
mqjeff
PostPosted: Wed Jul 10, 2013 6:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
Cache loading generally happens in the constructor of your Singleton object if you have one. This method does not hold up the first message, and the cache gets loaded at startup. Be sure to have ample logging.


A Singleton is a design pattern.

It is not a specific Java class.

Yes, this could be done in this specific case, a Java object could be created that uses the Singleton pattern, and that object could be instantiated from a JavaCompute node init method.

Regardless, any user of a cache has to be aware of those conditions in which the cache is properly preloaded and those cases where the cache is improperly empty, and make decisions about how to handle this, including making a request for the cache to be loaded and blocking until it is reloaded.

Another possible implementation is a TimeoutNotification node that fires off every day or week or hour, and checks if the cache is loaded or not, and loads it if it isn't.
Back to top
View user's profile Send private message
vikas.bhu
PostPosted: Fri Jul 12, 2013 3:37 am    Post subject: Reply with quote

Disciple

Joined: 17 May 2009
Posts: 159

@mickey1691:you can take help of timer nodes and achive it.
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 » Message Flow - Execute on startup only
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.