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

Ask Your Question

Session Based Messaging notifications after failover


I've got a primary-backup cluster running and I register for notifications for certain actions using the Session Based Messaging notifications. All works fine while both Primary and Backup cluster members are up... when the primary is unplugged, the backup does not send notifications. When the Primary is plugged back in, the Primary does not send notifications either.

I've read http://www.gigaspaces.com/wiki/displa... and read the section on Replicate Notify Template and Trigger Notify Template.

I set the "replicate-notify-templates" option to true inside gs.properties. This did not seem to make any difference.

I also tried the EventSessionConfig.setReplicateNotifyTemplate(true) call in my client code, with no luck either.

What am I doing wrong here? Why do I not see the notifications from the backup once the primary goes offline?



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

asked 2010-03-18 13:32:49 -0500

jazzbutcher gravatar image

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

Do you see the notify template at the backup space?
Check the class view - the lower part include a tab that lists the registered notify templates.

answered 2010-03-19 08:49:42 -0500

shay hassidim gravatar image
edit flag offensive delete link more



I've never seen this tab before -- that's good to know about...

The templates are indeed in there. I am surprised to see this. So, if the templates are in the backup space while both machines are running, and then after unplugging the primary. What does that tell us about this issue? What am I missing here?



jazzbutcher gravatar imagejazzbutcher ( 2010-03-19 10:42:20 -0500 )edit

If you have the notify template at the backup then you should get notifications from the backup once it becomes primary.

Can you provide the code you use to register for notifications ?


shay hassidim gravatar imageshay hassidim ( 2010-03-19 11:27:29 -0500 )edit

Well, based on what you're describing, I agree that I should be getting notifications... but, I'm not....

Here's the meat of the code that does the work:

public void register( boolean fifo ) throws SpaceException {

    if ( _registration != null ) {
        throw new IllegalArgumentException( "already registered" ) ;

    EventSessionFactory factory = EventSessionFactory.getFactory( _space.getIJSpace() ) ;
    EventSessionConfig config = new EventSessionConfig() ;
    config.setFifo( fifo ) ;
    config.setReplicateNotifyTemplate(true); // try this

    try {
        _session = factory.newDataEventSession( config, null ) ;

        _registration = _session.addListener( _template,
                                              NotifyActionType.NOTIFY_WRITE ) ;

    } catch ( RemoteException e ) {
        throw new SpaceException( e ) ;
    } catch ( TransactionException e ) {
        throw new SpaceException( e ) ;
jazzbutcher gravatar imagejazzbutcher ( 2010-03-19 13:49:32 -0500 )edit

Can you post a full test case? Would setting fifo to false provide different behavior? Shay

shay hassidim gravatar imageshay hassidim ( 2010-03-21 22:27:04 -0500 )edit

I don't have an easy-to-wrap-up test case at the moment.

I was hoping you could tell me some things to look for given the behavior I'm seeing... Are there any other configuration options I should look at here?

Due to the number of changes required to disable FIFO behavior, I've not tried it without FIFO, as our application depends on this.


jazzbutcher gravatar imagejazzbutcher ( 2010-03-23 12:34:00 -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


Asked: 2010-03-18 13:32:49 -0500

Seen: 59 times

Last updated: Mar 19 '10