Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Publish messages from Gigaspace

I have a PU that loads data and multiple processes that fetches the data from PU on start-up.

Now the PU is refreshed with some time interval, say 1 day. Is there a way to notify all the processes about the refresh?

Thanks.

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3483]{quote}

asked 2010-08-10 10:13:17 -0500

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Have all the processes register for notification for a write for a "RefreshCommand" and write such an object into the space once the refresh has been completed.
Shay

answered 2010-08-10 10:29:47 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Can you please point us to an example of this.

Thx

nitinmalik gravatar imagenitinmalik ( 2010-08-10 13:42:20 -0500 )edit

There are two options:

Notify Container (high level API): http://www.gigaspaces.com/wiki/displa...

And the Session Based Messaging API (low level API): http://www.gigaspaces.com/wiki/displa...

You will find code examples within each of the above links. Shay

shay hassidim gravatar imageshay hassidim ( 2010-08-10 13:49:58 -0500 )edit

Hi Shay,

That works like a charm. Thanks

-Vivek.

giga123master gravatar imagegiga123master ( 2010-08-10 15:46:22 -0500 )edit

Can you clarify what the valid values for lease are? Didnt find any documentation/javado on this.

EventRegistration registration = session.addListener(new MyData(),this,Lease.FOREVER,null,null,NotifyActionType.NOTIFY_ALL);

Our usecase requires notifying a client of the space of a change in data. Is there any advantage of using either of the 2 notification mechanism in this case?

nitinmalik gravatar imagenitinmalik ( 2010-08-10 20:28:47 -0500 )edit

Thanks all. The last example mentioned at http://www.gigaspaces.com/wiki/display/XAP71/NotifyContainer (public void myEventHandler example) works brilliantly for our requirement.

However, just to clarify, is it normal practice to register for events on a remote container i.e., where the listener is a client not co-located with the space. Do you see any pitfalls, with the approach, that we should watch out for?

Regards
Satish

satishramakrishnan gravatar imagesatishramakrishnan ( 2010-08-11 08:50:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2010-08-10 10:13:17 -0500

Seen: 9 times

Last updated: Aug 10 '10