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 » Shared variable across message flows.

Post new topic  Reply to topic
 Shared variable across message flows. « View previous topic :: View next topic » 
Author Message
saturn_cemk
PostPosted: Sun Jun 29, 2008 11:48 pm    Post subject: Shared variable across message flows. Reply with quote

Novice

Joined: 10 Jul 2006
Posts: 16

Hi all,

I have the following scenario (am using MB6.0)

1. There are two message flows (will refer to them as Flow1 and Flow2) deployed under the same EG. I have declared a SHARED Variable outside the module with a default value within Flow1.

2. I SET the value of the SHARED Variable using some element value from the Input Message.

3. I want to access this SHARED Variable from Flow2.

As far as my knowledge goes, the new value (one being SET in Flow1) of the SHARED Variable will die once the execution of Flow1 finishes (however the default value persists). This is an expected behavior.

Is there a round about way of handling this situation ? I am not thinking of using the 'Cache Support Pack' as of now.

Also does MB6.1 support this kind of a scenario ?

Thanks.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Mon Jun 30, 2008 1:11 am    Post subject: Reply with quote

Jedi

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

There is something you have to know about

ATOMIC variables
EXTERNAL variables

Please have a look of the above two, it will help you to find the solution
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
golam1983
PostPosted: Mon Jun 30, 2008 3:51 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

I think ATOMIC is not a variable... its an statement to prevent to access in use shared variable..

EXTERNAL variable is for something to use with user defined properties....

moreover we can't edit once initialize...
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Mon Jun 30, 2008 4:50 am    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

A SHARED variable is only available for the same message flow in the same EG. Thus, in your example - Flow1 and Flow2 would not see the same SHARED variable.

You may want to investigate the SupportPacs.
_________________
Bill Matthews
Back to top
View user's profile Send private message
AkankshA
PostPosted: Mon Jun 30, 2008 11:29 pm    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

golam1983 wrote:
I think ATOMIC is not a variable... its an statement to prevent to access in use shared variable..

EXTERNAL variable is for something to use with user defined properties....

moreover we can't edit once initialize...



We can edit external variable once set.... at runtime too...
external shall fulfill ur requirement
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
smdavies99
PostPosted: Tue Jul 01, 2008 3:50 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.

An example of one use of this type of ESQL is:-

Where variable declared as EXTERNAL & used in conjunction with the ATOMIC statement to share data between different instances of the same Flow.

I used a set of EXTERNAL variables to hold counters of messages sent. These were updated by a common bit of ESQL that did the update inside an ATOMIC section so that the counter could be only be updated by one instance at a time.

A Timer node was set to run every 10 seconds. This (again in an ATOMIC) section copied the current counts to another set of variables, and zeroed the original counts. Once outide the ATOMIC control, the new values were updated in a Database.
This have been in production use for getting on for 1.5 years now and processes over 500,000 messages per day and has given perfectly accurate results to date.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Shared variable across message flows.
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.