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 » How to access the shared varibles

Post new topic  Reply to topic
 How to access the shared varibles « View previous topic :: View next topic » 
Author Message
ein
PostPosted: Fri Dec 24, 2010 4:14 am    Post subject: How to access the shared varibles Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

Hi,

I have been working wmb. but i never come across the situation like this.

I am using the WMB 7.0. I declare one shared variables in one of my message flow. I need to use this shared varible in anothermessage flow.
Do i need to re declare the same varibles in another message flow.

As per my knowldge it's not required to declared. But How we can acess it.
The tool kit itself has to display when we press ctrl+space all variables. But it does not show.

Can anybody please help me on this.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Dec 24, 2010 4:44 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

You can only access shared variables in other instances of the same message flow. The idea is to pass values from other invocation of a given flow to another, not between different flows (although this would be useful).
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Dec 24, 2010 5:04 am    Post subject: Reply with quote

Jedi Knight

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

One technique is to use a Singleton. This allows you to share information between all message flows within an Execution Group.

The first message into the Execution Group automatically creates the Singleton object. It works just like any Java Singleton. Here is a link.

http://en.wikipedia.org/wiki/Singleton_pattern

If you have questions about it, please post.
_________________
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: Fri Dec 24, 2010 5:06 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
One technique is to use a Singleton. This allows you to share information between all message flows within an Execution Group

This only works within a JavaCompute node, because it's only Java that you have access to things that can run this way.

Well, I guess it might work in a PHPCompute node.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Dec 24, 2010 5:11 am    Post subject: Reply with quote

Jedi Knight

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

@mqjeff

Since ESQL can call Java classes in jar files contained within the shared-classes directory, would it not be possible that ESQL Compute nodes also access these shared variables if the Singleton class were published in a jar file to said directory?
_________________
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: Fri Dec 24, 2010 5:16 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
@mqjeff

Since ESQL can call Java classes in jar files contained within the shared-classes directory, would it not be possible that ESQL Compute nodes also access these shared variables if the Singleton class were published in a jar file to said directory?


That's basically what the Cache supportPac does.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Dec 24, 2010 5:27 am    Post subject: Reply with quote

Jedi Knight

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

mqjeff wrote:
lancelotlinc wrote:
@mqjeff

Since ESQL can call Java classes in jar files contained within the shared-classes directory, would it not be possible that ESQL Compute nodes also access these shared variables if the Singleton class were published in a jar file to said directory?


That's basically what the Cache supportPac does.


I respectfully disagree with your equation. The Cache support pac uses queues to store information. This is wasteful and needless I/O. Singleton is in-memory and fast. No I/O required. The OP just wants to share a simple variable.
_________________
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: Fri Dec 24, 2010 5:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

lancelotlinc wrote:
mqjeff wrote:
lancelotlinc wrote:
@mqjeff

Since ESQL can call Java classes in jar files contained within the shared-classes directory, would it not be possible that ESQL Compute nodes also access these shared variables if the Singleton class were published in a jar file to said directory?


That's basically what the Cache supportPac does.


I respectfully disagree with your equation. The Cache support pac uses queues to store information. This is wasteful and needless I/O. Singleton is in-memory and fast. No I/O required. The OP just wants to share a simple variable.


First off, I'm forced to disagree with your disagreement. Do you have *any* form of proof of your assertion that IA91 uses queues at all? Documentation that states such?

To the best of my knowledge, the closest it comes is using the RealTime pub/sub to communicated between different Brokers, and for anything that is strictly within the EG, it is indeed all in memory.

Secondly, regardless of whether or not IA91 uses queues, that's not what I said. I said that IA91 used static Java procedures to allow access to it's functionality from ESQL.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Dec 24, 2010 5:43 am    Post subject: Reply with quote

Jedi Knight

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

First off, Merry Christmas to you Sir Jeff.

Maybe I need more caffeine, but my eyes show these Pre-reqs for IA91:

Quote:

Prerequisites
This SupportPac requires:
• WebSphere Message Broker .
• WebSphere MQ (for broker cache).
• V6 only – Requires fix IY77292 or CSD01 for broker level caching




The doc

ftp://public.dhe.ibm.com/software/integration/support/supportpacs/individual/ia91.wbimb.pdf

The SupportPac is great if you need a heavy implementation to share variables. It seems to me it is overkill when a one-liner could do the trick through a Singleton class.
_________________
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: Fri Dec 24, 2010 5:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

See page 42 of the doc.
Quote:
Each named Cache uses memory within the JVM of the broker’s execution group.

Back to top
View user's profile Send private message
zpat
PostPosted: Fri Dec 24, 2010 6:04 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Getting back to shared variables, don't forget to use BEGIN ATOMIC when you update them.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Fri Dec 24, 2010 6:05 am    Post subject: Reply with quote

Jedi Knight

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

zpat wrote:
Getting back to shared variables, don't forget to use BEGIN ATOMIC when you update them.


In Java, on a Singleton, this would be using the "synchronized" keyword.
_________________
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
lancelotlinc
PostPosted: Fri Dec 24, 2010 6:07 am    Post subject: Reply with quote

Jedi Knight

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

mqjeff wrote:
See page 42 of the doc.
Quote:
Each named Cache uses memory within the JVM of the broker’s execution group.



I surrender to your point, sir.
_________________
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 Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to access the shared varibles
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.