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 » Cache node over shared variable

Post new topic  Reply to topic Goto page 1, 2  Next
 Cache node over shared variable « View previous topic :: View next topic » 
Author Message
ajith_company
PostPosted: Wed May 30, 2012 12:42 am    Post subject: Cache node over shared variable Reply with quote

Newbie

Joined: 30 May 2012
Posts: 3

What is the advantage of cache node over shared variable?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed May 30, 2012 2:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The cache node can share data between execution groups.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed May 30, 2012 5:53 am    Post subject: Reply with quote

Jedi Knight

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

The cache node uses a Singleton and queues internally to share data. If you are an experienced Java programmer, you can use a Singleton directly and avoid the overhead of using queues to store cache data.
_________________
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
Esa
PostPosted: Wed May 30, 2012 6:07 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

lancelotlinc wrote:
The cache node uses a Singleton and queues internally to share data. If you are an experienced Java programmer, you can use a Singleton directly and avoid the overhead of using queues to store cache data.


And then you cannot share data between execution groups.
But with shared variables you can only share data within one flow file in one execution group.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed May 30, 2012 6:10 am    Post subject: Reply with quote

Jedi Knight

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

Esa wrote:
lancelotlinc wrote:
The cache node uses a Singleton and queues internally to share data. If you are an experienced Java programmer, you can use a Singleton directly and avoid the overhead of using queues to store cache data.


And then you cannot share data between execution groups.
But with shared variables you can only share data within one flow file in one execution group.


We use a Singleton, and we share data between EGs. Why cannot you?
_________________
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
Esa
PostPosted: Wed May 30, 2012 6:15 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

lancelotlinc wrote:
Esa wrote:
lancelotlinc wrote:
The cache node uses a Singleton and queues internally to share data. If you are an experienced Java programmer, you can use a Singleton directly and avoid the overhead of using queues to store cache data.


And then you cannot share data between execution groups.
But with shared variables you can only share data within one flow file in one execution group.


We use a Singleton, and we share data between EGs. Why cannot you?


Well, it has never crossed my mind to share a Singleton across JVM's. I must admit that I thought it's not possible.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed May 30, 2012 6:17 am    Post subject: Reply with quote

Jedi Knight

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

Esa wrote:
lancelotlinc wrote:
Esa wrote:
lancelotlinc wrote:
The cache node uses a Singleton and queues internally to share data. If you are an experienced Java programmer, you can use a Singleton directly and avoid the overhead of using queues to store cache data.


And then you cannot share data between execution groups.
But with shared variables you can only share data within one flow file in one execution group.


We use a Singleton, and we share data between EGs. Why cannot you?


Well, it has never crossed my mind to share a Singleton across JVM's. I must admit that I thought it's not possible.


You have never created any application that used inter-process communication? You've never used mutexes, or semaphores? Named-pipes?
_________________
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 May 30, 2012 6:25 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The use of a Singleton does not provide any automatic mechanism that requires no programming to provide data that is available in more than one DFE.

The use of ESQL shared variables or of Java static variables does not provide any automatic mechanism that requires no programming to provide data that is available in more than one DFE.

The use of the Cache node supportPac allows for an administrative configuration, that can be made after development is complete, that provides data that is available in more than one DFE without any additional programming.

That is the advantage of the Cache node supportPac.
Back to top
View user's profile Send private message
Esa
PostPosted: Wed May 30, 2012 6:26 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

lancelotlinc wrote:

You have never created any application that used inter-process communication? You've never used mutexes, or semaphores? Named-pipes?


I haven't needed to.

I guess your Singleton lives outside the broker. Do you share data accross brokers, too?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Wed May 30, 2012 6:28 am    Post subject: Reply with quote

Jedi Knight

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

Very well stated, mqjeff. The support pak provides a way to cache data through administrative configuration. I like your synopsis.
_________________
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: Wed May 30, 2012 6:31 am    Post subject: Reply with quote

Jedi Knight

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

Esa wrote:
lancelotlinc wrote:

You have never created any application that used inter-process communication? You've never used mutexes, or semaphores? Named-pipes?


I haven't needed to.

I guess your Singleton lives outside the broker. Do you share data accross brokers, too?


The inter-process communication mechanism has no restrictions on boundaries, as long as you can access the interface through TCP/IP. We use JMX managed beans as cache objects, which can also be browsed by an adminstrator as cache data is being held, using either a standard web browser or jconsole, which ever suits your taste.
_________________
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
rekarm01
PostPosted: Wed May 30, 2012 11:51 pm    Post subject: Re: Cache node over shared variable Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

lancelotlinc wrote:
We use a Singleton, and we share data between EGs.

A Singleton? It seems like it would require more than one.

In this case, what is the advantage of singletons, over static class methods/variables?
Back to top
View user's profile Send private message
Esa
PostPosted: Thu May 31, 2012 12:01 am    Post subject: Re: Cache node over shared variable Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

rekarm01 wrote:
A Singleton? It seems like it would require more than one.


This has been discussed above...

rekarm01 wrote:

In this case, what is the advantage of singletons, over static class methods/variables?


A singleton is just a pattern for synchronizing access to the (cache) object to make sure that everyone is accessing the same object and that only one thread at a time is allowed to update it. A standard way of using static varibles/methods for a certain purpose.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu May 31, 2012 1:24 am    Post subject: Re: Cache node over shared variable Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Esa wrote:
rekarm01 wrote:

In this case, what is the advantage of singletons, over static class methods/variables?


A singleton is just a pattern for synchronizing access to the (cache) object to make sure that everyone is accessing the same object and that only one thread at a time is allowed to update it. A standard way of using static varibles/methods for a certain purpose.


An ESQL shared variable wrapped in method calls that enforce BEGIN ATOMIC probably counts as a Singleton.
Back to top
View user's profile Send private message
Esa
PostPosted: Thu May 31, 2012 1:27 am    Post subject: Re: Cache node over shared variable Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

mqjeff wrote:

An ESQL shared variable wrapped in method calls that enforce BEGIN ATOMIC probably counts as a Singleton.


The only major difference being a more limited scope.
Back to top
View user's profile Send private message
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 » Cache node over shared variable
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.